Exemplo n.º 1
0
 public function getSaveData($mData)
 {
     ReferencePeer::removeReferences($this->oLanguageObject);
     if (isset($mData['document_id'])) {
         foreach ($mData['document_id'] as $iDocumentId) {
             if ($iDocumentId) {
                 ReferencePeer::addReference($this->oLanguageObject, array($iDocumentId, 'Document'));
             }
         }
     }
     return $this->dataFromPost($mData);
 }
Exemplo n.º 2
0
 public function widgetSave($mData)
 {
     $this->oLanguageObject->setData(serialize($mData));
     $bResult = $this->oLanguageObject->save();
     if ($bResult) {
         if (isset($mData['link_categories'])) {
             ReferencePeer::removeReferences($this->oLanguageObject);
             foreach ($mData['link_categories'] as $iCategoryId) {
                 ReferencePeer::addReference($this->oLanguageObject, array($iCategoryId, 'LinkCategory'));
             }
         }
     }
     return $bResult;
 }
Exemplo n.º 3
0
 public static function doDelete($values, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(PagePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
     }
     if ($values instanceof Criteria) {
         // rename for clarity
         $criteria = clone $values;
     } elseif ($values instanceof LanguageObject) {
         // it's a model object
         // create criteria based on pk values
         $criteria = $values->buildPkeyCriteria();
     } else {
         // it's a primary key, or an array of pks
         $criteria = new Criteria(self::DATABASE_NAME);
         $criteria->add(PagePeer::ID, (array) $values, Criteria::IN);
     }
     foreach (LanguageObjectPeer::doSelect(clone $criteria, $con) as $object) {
         ReferencePeer::removeReferences($object);
     }
     return self::doDeleteBeforeReferencing($criteria, $con);
 }
 public function getSaveData($mData)
 {
     if ($this->oLanguageObject instanceof LanguageObject) {
         ReferencePeer::removeReferences($this->oLanguageObject);
         if (isset($mData['document_categories'])) {
             foreach ($mData['document_categories'] as $iCategoryId) {
                 ReferencePeer::addReference($this->oLanguageObject, array($iCategoryId, 'DocumentCategory'));
             }
         }
     }
     return parent::getSaveData($mData);
 }
Exemplo n.º 5
0
 public function setTrackReferences($mTrackReferences)
 {
     $this->mTrackReferences = $mTrackReferences;
     if ($this->mTrackReferences !== null) {
         // delete all references before saving the tracked ones
         ReferencePeer::removeReferences($this->mTrackReferences);
     }
 }