我一直在关注这个
Symfony教程.在某些部分中,它只是告诉我在类中添加一个公共函数,但它没有说我是否应该在类的开头或结尾添加它.
例如:
/**
* JobeetCategory
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @package jobeet
* @subpackage model
* @author Your name here
* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
*/
class JobeetCategory extends BaseJobeetCategory
{
public function countActiveJobs()
{
$q = Doctrine_Query::create()
->from('JobeetJob j')
->where('j.category_id = ?', $this->getId());
return Doctrine_Core::getTable('JobeetJob')->countActiveJobs($q);
}
public function getSlug()
{
return Jobeet::slugify($this->getName());
}
public function getActiveJobs($max = 10)
{
$q = Doctrine_Query::create()
->from('JobeetJob j')
->where('j.category_id = ?', $this->getId())
->limit($max);
return Doctrine_Core::getTable('JobeetJob')->getActiveJobs($q);
}
}
getActiveJObs公共函数是本教程中第一个显示的,countActiveJobs是我根据教程添加的最后一个函数.
一个类中的公共函数的顺序是否重要?