public function setup() { parent::setup(); $this->validatorSchema->setOption('allow_extra_fields', true); unset($this['site_id'], $this['created_at'], $this['updated_at'], $this['last_updated_by_id'], $this['slots_list'], $this['links_list'], $this['assets_list']); $q = Doctrine_Query::create()->from('sfSympalMenuItem m')->orderBy('m.root_id, m.lft ASC'); if (sfSympalConfig::isI18nEnabled('sfSympalMenuItem')) { $q->leftJoin('m.Translation mt'); } if (!$this->object->content_type_id) { $this->object->Type = Doctrine_Core::getTable('sfSympalContentType')->findOneBySlug('page'); } else { $this->object->Type; } $this->_embedTypeForm(); }
public function save($con = null) { $content = parent::save($con); // then menu creation has been requested if ($this->getValue('menu_create')) { $menuItem = $content->getMenuItem(); $menuItem->bindSympalContent($content); if ($this->getValue('menu_publish')) { $menuItem->setDatePublished(date('Y-m-d H:i:s')); } if (strlen($this->getValue('menu_parent_id')) > 0) { $menuItem->getNode()->insertAsLastChildOf(Doctrine_Core::getTable('sfSympalMenuItem')->find($this->getValue('menu_parent_id'))); } else { $menuItem->save(); } } return $content; }