I'm looking at some code I have inherited. In all the Model classes - any method that does a "Select" query has been declared as static where as the "insert", "update", "delete" are not declared as static in the same Model class.
For example
require_once 'Zend/Db/Table/Abstract.php'; class Model_Course extends Zend_Db_Table_Abstract { protected $_name = 'course'; public static function getCoursesByFaculty($faculty_id) { $courseModel = new self(); $select = $courseModel->select(); $select->setIntegrityCheck(false); $select->from('course', 'course.*'); $select->joinLeft('course_faculty', 'course.course_id = course_faculty.course_id'); $select->order(array('title')); $select->where('faculty_id = '.$faculty_id); return $courseModel->fetchAll($select); } }
Is there any good reason/advantages for declaring these methods as static ?
Thanks for your input