Exemplo n.º 1
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = BudgetPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setCode($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setBudgetCategoryId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setBudgetStatusId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setBudgetChartId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setChartAccount($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setTotal($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setCreatedAt($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setUpdatedAt($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setNote($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setYear($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setMonth($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setTotalBudget($arr[$keys[12]]);
     }
 }
Exemplo n.º 2
0
 public function getBudgetsJoinBudgetStatus($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseBudgetPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collBudgets === null) {
         if ($this->isNew()) {
             $this->collBudgets = array();
         } else {
             $criteria->add(BudgetPeer::BUDGET_CHART_ID, $this->getId());
             $this->collBudgets = BudgetPeer::doSelectJoinBudgetStatus($criteria, $con);
         }
     } else {
         $criteria->add(BudgetPeer::BUDGET_CHART_ID, $this->getId());
         if (!isset($this->lastBudgetCriteria) || !$this->lastBudgetCriteria->equals($criteria)) {
             $this->collBudgets = BudgetPeer::doSelectJoinBudgetStatus($criteria, $con);
         }
     }
     $this->lastBudgetCriteria = $criteria;
     return $this->collBudgets;
 }
Exemplo n.º 3
0
 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(BudgetPeer::ID, $pks, Criteria::IN);
         $objs = BudgetPeer::doSelect($criteria, $con);
     }
     return $objs;
 }