The Datamodel: Comment
This class is an implementation of the active record pattern and has been created in order to simplify
the access to the "Comment" table.
Each Comment belongs to an Article.
Accessible methods:
- public function getId():
return the id of the Comment instance.
- public static function findById($id):
return an Comment querying the database.
- public static function findAll():
return an array of all Comment(s) contained in the database.
- public static function findLastN($n):
return an array of the last $n Comment(s) contained
in the database.
- public static function findByTitle($title):
return an array of Comment(s) containing a Title matching
the string $title.
- public static function findInAllTextFields($string):
return an array of Comment(s) containing
at least a field matching the string $string.
- public function article():
return the
Article related the the Comment instance.
- public function save():
save the courrent instance.
- public function delete():
delete from the database the courrent instance and reset all the
instance fields.
- protected function insert():
insert a new instance in the database.
- protected function update():
update the courrent instance in the corresponding database record
- public function getMaxId():
return an Integer value containing the bigger
id field in the table "Comment".
- public function getArticle_id():
return the id of the article linked to the Comment instance.
- public function setArticle_id($id):
set the id of the article linked to the Comment instance.
- public function getTitle():
return the Title of the Comment instance, filtered by the filters
definited in the plugins activated by the publisher.
- public function getUnfilteredTitle():
return the Title of the Comment instance, unfiltered.
- public function setTitle($title):
set the Title of the instance of the Comment.
- public function getPublished():
return the content of the flag published in the Comment instance.
- public function setPublished($published):
set the flag published in the Comment instance.
- public function getBody():
return the Body of the Comment instance, filtered by the filters
definited in the plugins activated.
- public function getUnfilteredBody():
return the Body of the Comment instance, unfiltered.
- public function setBody($body):
set the Body of the instance of the Comment.
- public function getSignature():
return the Signature of the Comment instance, filtered by the filters
definited in the plugins activated.
- public function getUnfilteredSignature():
return the Signature of the Comment instance, unfiltered.
- public function setSignature($signature):
set the Signature of the instance of the Comment.
- public function getCreated():
return the Creation date of the Comment instance.
- public function getCreatedFormatted():
return the Creation date of the Comment instance.
Tha date is formatted in order to appear more user friendly.
- public function setCreated($created):
set the Creation date of the instance of the Comment.
- public function getUpdated():
return the Update date of the Comment instance.
- public function setUpdated($updated):
set the Update date of the instance of the Comment.