Exemple #1
0
 public function getInboxsJoinStudent($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseInboxPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collInboxs === null) {
         if ($this->isNew()) {
             $this->collInboxs = array();
         } else {
             $criteria->add(InboxPeer::EMPLOYEE_ID, $this->getId());
             $this->collInboxs = InboxPeer::doSelectJoinStudent($criteria, $con);
         }
     } else {
         $criteria->add(InboxPeer::EMPLOYEE_ID, $this->getId());
         if (!isset($this->lastInboxCriteria) || !$this->lastInboxCriteria->equals($criteria)) {
             $this->collInboxs = InboxPeer::doSelectJoinStudent($criteria, $con);
         }
     }
     $this->lastInboxCriteria = $criteria;
     return $this->collInboxs;
 }
Exemple #2
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = InboxPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setStudentId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setEmployeeId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setSubject($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setDetail($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setCreatedAt($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setType($arr[$keys[6]]);
     }
 }
Exemple #3
0
 public function executeDeleteByEmployee()
 {
     $employee_id = $this->getRequestParameter('employee_id');
     $employee = EmployeePeer::retrieveByPk($employee_id);
     $this->forward404Unless($employee);
     $outbox = InboxPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($outbox);
     $outbox->delete();
     return $this->redirect('outbox/byEmployee?employee_id=' . $employee->getId());
 }
Exemple #4
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(InboxPeer::ID, $pks, Criteria::IN);
         $objs = InboxPeer::doSelect($criteria, $con);
     }
     return $objs;
 }