Example #1
0
 public static function retrieveByPK($id, $culture, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(MemberJobI18nPeer::ID, $id);
     $criteria->add(MemberJobI18nPeer::CULTURE, $culture);
     $v = MemberJobI18nPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }
Example #2
0
 public function getCurrentMemberJobI18n()
 {
     if (!isset($this->current_i18n[$this->culture])) {
         $obj = MemberJobI18nPeer::retrieveByPK($this->getId(), $this->culture);
         if ($obj) {
             $this->setMemberJobI18nForCulture($obj, $this->culture);
         } else {
             $this->setMemberJobI18nForCulture(new MemberJobI18n(), $this->culture);
             $this->current_i18n[$this->culture]->setCulture($this->culture);
         }
     }
     return $this->current_i18n[$this->culture];
 }
Example #3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = MemberJobI18nPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setName($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setCulture($arr[$keys[2]]);
     }
 }
Example #4
0
 protected static function doOnDeleteCascade(Criteria $criteria, Connection $con)
 {
     $affectedRows = 0;
     $objects = MemberJobPeer::doSelect($criteria, $con);
     foreach ($objects as $obj) {
         include_once 'lib/model/MemberJobI18n.php';
         $c = new Criteria();
         $c->add(MemberJobI18nPeer::ID, $obj->getId());
         $affectedRows += MemberJobI18nPeer::doDelete($c, $con);
     }
     return $affectedRows;
 }