public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = ListitemPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setLabel($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setValue($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setCreatedAt($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setUpdatedAt($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setPublicationStatus($arr[$keys[5]]); } }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(ListitemPeer::ID, $pks, Criteria::IN); $objs = ListitemPeer::doSelect($criteria, $con); } return $objs; }
public static function lists_search(&$c, &$pager) { self::getSearchParams($context, $user, $request, $keys, $stype); $pager = "Lists"; $c->add(ListsPeer::LABEL, $keys, Criteria::LIKE); $res = ListsPeer::doSelect($c); $c = new Criteria(); $c->add(ListitemI18nPeer::LABEL, keys, Criteria::LIKE); $res2 = ListitemI18nPeer::doSelect($c); $c = new Criteria(); $c->add(ListitemPeer::LABEL, $keys, Criteria::LIKE); $res3 = ListitemPeer::doSelect($c); $c = array_merge($res, array_merge($res2, $res3)); }
public static function getLanguageBar($parent, $moduleName = '') { $parentDoc = Document::getDocumentInstance($parent); $children = Document::getChildrenOf($parent, get_class($parentDoc) . "I18n"); $childrenArray = array(); $iconExtension = '.gif'; // if we load an other module tree (config in <mymodule>/config/leftTree.xml param "parent" on tag <objects>) /*$leftTree = XMLParser::getXMLdataValues(sfConfig::get('sf_root_dir')."/apps/backend/modules/".strtolower($moduleName)."/config/leftTree.xml"); if ($leftTree[0]['attributes']['PARENT']) { return null; }*/ $i = 0; foreach ($children as $child) { $childClass = get_class($child); $childrenArray[$i]['id'] = $child->getId(); $culture = $child->getCulture(); $con = Propel::getConnection(); $con->begin(); $c = new Criteria(); $c->addAnd(ListitemPeer::VALUE, $culture, Criteria::EQUAL); $cultureObj = ListitemPeer::doSelectOne($c); $childrenArray[$i]['culture'] = $cultureObj; $childrenArray[$i]['type'] = $childClass; $childrenArray[$i]['class'] = strtolower($moduleName) . '_' . strtolower($childClass); $childrenArray[$i]['style'] = "background: url(/images/icons/" . $culture . $iconExtension . ") 0 0 no-repeat;"; $i++; } return $childrenArray; }