Beispiel #1
0
 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         $genericDocument->delete();
         //deletes any tags for this document
         $c = new Criteria();
         $c->add(TagrelationPeer::TAG_ID, $this->getId());
         $tagRelations = TagrelationPeer::doSelect($c);
         foreach ($tagRelations as $tag) {
             $tag->delete();
         }
         parent::delete();
         $con->commit();
         if (sfConfig::get('sf_cache_relations')) {
             Tagrelation::updateTagRelationCache();
         }
         Document::deleteObjCache($this);
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
Beispiel #2
0
 public function postUpdate(PropelPDO $con = null)
 {
     parent::postUpdate($con);
     if (!$this->alreadyInSave) {
         kEventsManager::raiseEvent(new kObjectUpdatedEvent($this));
     }
 }
Beispiel #3
0
 /**
  * Construct the tag.
  *
  * @param  string  $location
  * @param  string  $lastModified
  * @param  string  $changeFrequency
  * @param  string  $priority
  * @return void
  */
 public function __construct($location, $lastModified = null, $changeFrequency = null, $priority = null, $multiLangual = null)
 {
     parent::__construct($location, $lastModified);
     $this->changeFrequency = $changeFrequency;
     $this->priority = $priority;
     $this->multilang = $multiLangual;
 }
Beispiel #4
0
 /**
  * Construct the tag.
  *
  * @param  string  $location
  * @param  string  $lastModified
  * @param  string  $changeFrequency
  * @param  string  $priority
  * @return void
  */
 public function __construct($location, $lastModified = null, $changeFrequency = null, $priority = null, $image = null)
 {
     parent::__construct($location, $lastModified);
     $this->changeFrequency = $changeFrequency;
     $this->priority = $priority;
     $this->image = $image;
 }
Beispiel #5
0
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new TagPeer();
     }
     return self::$peer;
 }
Beispiel #6
0
 public function setName($sNewName)
 {
     $sNewName = StringUtil::normalize($sNewName);
     parent::setName($sNewName);
 }
Beispiel #7
0
 public function setUp()
 {
     $this->hasMany('TagObiect', array('local' => 'id', 'foreign' => 'tag'));
     parent::setUp();
 }
Beispiel #8
0
 public function setTag($v)
 {
     parent::setTag($v);
     $this->setNormalizedTag($v);
 }
Beispiel #9
0
 public function init()
 {
     return parent::init();
 }