Ejemplo n.º 1
0
 public function getInboxEmpsRelatedByEmployee2JoinStudent($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseInboxEmpPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collInboxEmpsRelatedByEmployee2 === null) {
         if ($this->isNew()) {
             $this->collInboxEmpsRelatedByEmployee2 = array();
         } else {
             $criteria->add(InboxEmpPeer::EMPLOYEE_2, $this->getId());
             $this->collInboxEmpsRelatedByEmployee2 = InboxEmpPeer::doSelectJoinStudent($criteria, $con);
         }
     } else {
         $criteria->add(InboxEmpPeer::EMPLOYEE_2, $this->getId());
         if (!isset($this->lastInboxEmpRelatedByEmployee2Criteria) || !$this->lastInboxEmpRelatedByEmployee2Criteria->equals($criteria)) {
             $this->collInboxEmpsRelatedByEmployee2 = InboxEmpPeer::doSelectJoinStudent($criteria, $con);
         }
     }
     $this->lastInboxEmpRelatedByEmployee2Criteria = $criteria;
     return $this->collInboxEmpsRelatedByEmployee2;
 }
Ejemplo n.º 2
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(InboxEmpPeer::ID, $pks, Criteria::IN);
         $objs = InboxEmpPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Ejemplo n.º 3
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = InboxEmpPeer::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->setStudentId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setEmployeeId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setEmployee2($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setSubject($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setDetail($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setCreatedAt($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setType($arr[$keys[8]]);
     }
 }
Ejemplo n.º 4
0
 public function filter($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         $column = InboxEmpPeer::getTableMap()->getColumn($key);
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::DATE) {
             $c->add($name, $value, Criteria::LIKE);
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
Ejemplo n.º 5
0
 public function executeDelete()
 {
     $inbox_emp = InboxEmpPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($inbox_emp);
     $inbox_emp->delete();
     return $this->redirect('employee_email/list');
 }