public function executeEdit(sfWebRequest $request) { $this->getResponse()->addJavascript('/sfDoctrineActAsTaggablePlugin/js/pkTagahead.js', 'last'); if ($this->getUser()->hasCredential('admin')) { $this->a_blog_post = $this->getRoute()->getObject(); } else { $this->a_blog_post = Doctrine::getTable('aBlogPost')->findOneEditable($request->getParameter('id'), $this->getUser()->getGuardUser()->getId()); } $this->forward404Unless($this->a_blog_post); // Separate forms for separately saved fields $this->form = new aBlogPostForm($this->a_blog_post); // Retrieve the tags currently assigned to the blog post for the inlineTaggableWidget $this->existingTags = $this->form->getObject()->getTags(); // Retrieve the 10 most popular tags for the inlineTaggableWidget $this->popularTags = TagTable::getPopulars(null, array('model' => 'aBlogPost', 'sort_by_popularity' => true), false, 10); aBlogItemTable::populatePages(array($this->a_blog_post)); }