예제 #1
0
 /**
  * Exports the object as an array.
  *
  * You can specify the key type of the array by passing one of the class
  * type constants.
  *
  * @param     string  $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
  *                    TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
  *                    Defaults to TableMap::TYPE_PHPNAME.
  * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
  * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
  *
  * @return array an associative array containing the field names (as keys) and field values
  */
 public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
 {
     if (isset($alreadyDumpedObjects['CouponI18n'][serialize($this->getPrimaryKey())])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['CouponI18n'][serialize($this->getPrimaryKey())] = true;
     $keys = CouponI18nTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getId(), $keys[1] => $this->getLocale(), $keys[2] => $this->getTitle(), $keys[3] => $this->getShortDescription(), $keys[4] => $this->getDescription());
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aCoupon) {
             $result['Coupon'] = $this->aCoupon->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
     }
     return $result;
 }
예제 #2
0
 /**
  * Exports the object as an array.
  *
  * You can specify the key type of the array by passing one of the class
  * type constants.
  *
  * @param     string  $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
  *                    TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
  *                    Defaults to TableMap::TYPE_PHPNAME.
  * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
  * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
  *
  * @return array an associative array containing the field names (as keys) and field values
  */
 public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
 {
     if (isset($alreadyDumpedObjects['CouponCustomerCount'][$this->getPrimaryKey()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['CouponCustomerCount'][$this->getPrimaryKey()] = true;
     $keys = CouponCustomerCountTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getCouponId(), $keys[1] => $this->getCustomerId(), $keys[2] => $this->getCount());
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aCustomer) {
             $result['Customer'] = $this->aCustomer->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aCoupon) {
             $result['Coupon'] = $this->aCoupon->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
     }
     return $result;
 }
예제 #3
0
 /**
  * Exports the object as an array.
  *
  * You can specify the key type of the array by passing one of the class
  * type constants.
  *
  * @param     string  $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
  *                    TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
  *                    Defaults to TableMap::TYPE_PHPNAME.
  * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
  * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
  *
  * @return array an associative array containing the field names (as keys) and field values
  */
 public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
 {
     if (isset($alreadyDumpedObjects['CouponVersion'][serialize($this->getPrimaryKey())])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['CouponVersion'][serialize($this->getPrimaryKey())] = true;
     $keys = CouponVersionTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getId(), $keys[1] => $this->getCode(), $keys[2] => $this->getType(), $keys[3] => $this->getSerializedEffects(), $keys[4] => $this->getIsEnabled(), $keys[5] => $this->getStartDate(), $keys[6] => $this->getExpirationDate(), $keys[7] => $this->getMaxUsage(), $keys[8] => $this->getIsCumulative(), $keys[9] => $this->getIsRemovingPostage(), $keys[10] => $this->getIsAvailableOnSpecialOffers(), $keys[11] => $this->getIsUsed(), $keys[12] => $this->getSerializedConditions(), $keys[13] => $this->getPerCustomerUsageCount(), $keys[14] => $this->getCreatedAt(), $keys[15] => $this->getUpdatedAt(), $keys[16] => $this->getVersion(), $keys[17] => $this->getVersionCreatedAt(), $keys[18] => $this->getVersionCreatedBy());
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aCoupon) {
             $result['Coupon'] = $this->aCoupon->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
     }
     return $result;
 }