/** * Returns the choices associated to the model. * * @return array An array of choices */ public function getChoices() { $choices = array(); $add_empty = $this->getOption('add_empty'); if ($add_empty === true) { $choices[''] = array('level' => 0, 'label' => __('Root')); } $root_zones = ZonePeer::doSelectRoot(); $current_zone = $this->getOption('current_zone', null); foreach ($root_zones as $root_zone) { $this->addZoneChoice($choices, $root_zone, $current_zone, $add_empty ? 1 : 0); } return $choices; }
public function executeIndex(sfWebRequest $request) { $this->zone_list = ZonePeer::doSelectRoot(); $this->zone_total_count = ZonePeer::doCount(new Criteria()); $this->recursion = ZonePeer::getMaximumRecursion(); }