コード例 #1
0
ファイル: BaseEvent.php プロジェクト: emildev35/processmaker
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = EventPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setEvnUid($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setProUid($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setEvnStatus($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setEvnWhenOccurs($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setEvnRelatedTo($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setTasUid($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setEvnTasUidFrom($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setEvnTasUidTo($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setEvnTasEstimatedDuration($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setEvnTimeUnit($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setEvnWhen($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setEvnMaxAttempts($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setEvnAction($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setEvnConditions($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setEvnActionParameters($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setTriUid($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setEvnPosx($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setEvnPosy($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setEvnType($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setTasEvnUid($arr[$keys[19]]);
     }
 }
コード例 #2
0
ファイル: BaseEvent.php プロジェクト: soon0009/EMS
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = EventPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setTitle($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setSlug($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setStatusId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setCategoryId($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setPublished($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setMediaPotential($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setDescription($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setNotes($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setImageUrl($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setUpdatedAt($arr[$keys[10]]);
     }
 }
コード例 #3
0
ファイル: BaseEvent.php プロジェクト: yasirgit/afids
 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  * The default key type is the column's phpname (e.g. 'AuthorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = EventPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setEventName($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setEventDate($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setEventTime($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setLocation($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setShortDesc($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setLongDesc($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setContactInfo($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setEmailSentDate($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setOnlineReservation($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setAdultCost($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setChildCost($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setAdultDoorCost($arr[$keys[12]]);
     }
     if (array_key_exists($keys[13], $arr)) {
         $this->setChildDoorCost($arr[$keys[13]]);
     }
     if (array_key_exists($keys[14], $arr)) {
         $this->setSignupDeadline($arr[$keys[14]]);
     }
     if (array_key_exists($keys[15], $arr)) {
         $this->setOnsiteSignupOk($arr[$keys[15]]);
     }
     if (array_key_exists($keys[16], $arr)) {
         $this->setMaxPersons($arr[$keys[16]]);
     }
     if (array_key_exists($keys[17], $arr)) {
         $this->setCollectSecureInfo($arr[$keys[17]]);
     }
     if (array_key_exists($keys[18], $arr)) {
         $this->setAddlInfoFields($arr[$keys[18]]);
     }
     if (array_key_exists($keys[19], $arr)) {
         $this->setAddlInfoFieldsHelp($arr[$keys[19]]);
     }
 }