simpleblog / pieces / Entry.php

<?php

class Entry
{
    public $author;
    public $content;
    public $date;
    public $email;
    public $publish;

    function __construct(
        $author = "adam",
        $content = "I'm sorry but you need to know the question first.",
        $date = "19700101",
        $email = "adam@foobar.com",
        $publish = 0,
        $title = "Not sure.")
    {
        $this->author = $author;
        $this->content = $content;
        $this->date = $date;
        $this->email = $email;
        $this->publish = $publish;
        $this->title = $title;
    }

    function __destruct()
    {
    }

    function __toString()
    {
        return "
            <div class=\"entry\">
                <p class=\"date\">$this->date</p>
                <p class=\"byline\">$this->title by <a href=\"mailto:$this->email\">$this->author</a></p>
                <p class=\"post\">$this->content</p> 
            </div>
        "; 
    }

    function setAuthor($author)
    {
        $this->author = $author;
    }

    function getAuthor()
    {
        return $this->author;
    }

    function setContent($content)
    {
        $this->content = $content;
    }

    function getContent()
    {
        return $this->content;
    }

    function setDate($date)
    {
        $this->date = $date;
    }

    function getDate()
    {
        return $this->date;
    }

    function setEmail($email)
    {
        $this->email = $email;
    }
  
    function getEmail()
    {
        return $this->email;
    }

    function setPublish($publish)
    {
        $this->publish = $publish;
    } 
    
    function getPublish()
    {
        return $this->publish;
    }

    function setTitle($title)
    {
        $this->title = $title;
    }

    function getTitle($title)
    {
        return $this->title;
    }
}

?>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.