4 * ProjectMessages, generated on Sat, 04 Mar 2006 12:21:44 +0100 by
5 * DataObject generation tool
7 * @http://www.projectpier.org/
9 class ProjectMessages
extends BaseProjectMessages
{
12 * Return messages that belong to specific project
14 * @param Project $project
15 * @param boolean $include_private Include private messages in the result
18 static function getProjectMessages(Project
$project, $include_private = false) {
19 if($include_private) {
20 $conditions = array('`project_id` = ?', $project->getId());
22 $conditions = array('`project_id` = ? AND `is_private` = ?', $project->getId(), false);
25 return self
::findAll(array(
26 'conditions' => $conditions,
27 'order' => '`created_on` DESC',
29 } // getProjectMessages
32 * Return project messages that are marked as important for specific project
34 * @param Project $project
35 * @param boolean $include_private Include private messages
38 static function getImportantProjectMessages(Project
$project, $include_private = false) {
39 if($include_private) {
40 $conditions = array('`project_id` = ? AND `is_important` = ?', $project->getId(), true);
42 $conditions = array('`project_id` = ? AND `is_important` = ? AND `is_private` = ?', $project->getId(), true, false);
45 return self
::findAll(array(
46 'conditions' => $conditions,
47 'order' => '`created_on` DESC',
49 } // getImportantProjectMessages