I followed this symfony . In some sections, he simply tells me to add public functioninside class, but he does not say whether I should add it at the beginning or at the end of the class.
For instance:
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);
}
}
The open function getActiveJObswas first shown in the textbook, and the countActiveJobslast function that I added in accordance with the textbook.
Does the order of social functions within a class mean?
source
share