public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = ExpenditureJournalTaPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setBankAccountId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setAcademicCalendarId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setBiaya($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setAmount($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setPaid($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setReceivable($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->setWaktu($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setStatus($arr[$keys[10]]); } }
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(ExpenditureJournalTaPeer::ID, $pks, Criteria::IN); $objs = ExpenditureJournalTaPeer::doSelect($criteria, $con); } return $objs; }
public function executeDelete() { $expenditure_journal_ta = ExpenditureJournalTaPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($expenditure_journal_ta); $ref_error = 0; foreach ($expenditure_journal_ta->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $expenditure_journal_ta->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('expenditure_journal_ta/delete/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('expenditure_journal_ta/delete', '_ERR_DELETE_ (' . $expenditure_journal->toString() . ' - id:' . $expenditure_journal->getId() . ')'); } else { $expenditure_journal_ta->delete(); } return $this->forward('expenditure_journal_ta', 'list'); }