Example #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_CAMELNAME,
  *                    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['News'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['News'][$this->hashCode()] = true;
     $keys = NewsTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getNewsId(), $keys[1] => $this->getResourceId(), $keys[2] => $this->getNewsHeadline(), $keys[3] => $this->getNewsOpening(), $keys[4] => $this->getNewsBody(), $keys[5] => $this->getNewsPic(), $keys[6] => $this->getNewsFrom(), $keys[7] => $this->getNewsTo(), $keys[8] => $this->getNewsFor(), $keys[9] => $this->getNewsWeight(), $keys[10] => $this->getCreatedAt(), $keys[11] => $this->getUpdatedAt());
     if ($result[$keys[6]] instanceof \DateTime) {
         $result[$keys[6]] = $result[$keys[6]]->format('c');
     }
     if ($result[$keys[7]] instanceof \DateTime) {
         $result[$keys[7]] = $result[$keys[7]]->format('c');
     }
     if ($result[$keys[10]] instanceof \DateTime) {
         $result[$keys[10]] = $result[$keys[10]]->format('c');
     }
     if ($result[$keys[11]] instanceof \DateTime) {
         $result[$keys[11]] = $result[$keys[11]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aResourceRelatedByResourceId) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResourceRelatedByResourceId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aFile) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'file';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'file';
                     break;
                 default:
                     $key = 'File';
             }
             $result[$key] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aResourceRelatedByNewsFor) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResourceRelatedByNewsFor->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
     }
     return $result;
 }
Example #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_CAMELNAME,
  *                    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['ResourceFile'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['ResourceFile'][$this->hashCode()] = true;
     $keys = ResourceFileTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getResourceFileId(), $keys[1] => $this->getResourceId(), $keys[2] => $this->getFileId(), $keys[3] => $this->getResourceFileIsPublic());
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aResource) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResource->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aFile) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'file';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'file';
                     break;
                 default:
                     $key = 'File';
             }
             $result[$key] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
     }
     return $result;
 }
Example #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_CAMELNAME,
  *                    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['User'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['User'][$this->hashCode()] = true;
     $keys = UserTableMap::getFieldNames($keyType);
     $keys_resource = \App\Propel\Map\ResourceTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getUserId(), $keys[1] => $this->getResourceId(), $keys[2] => $this->getUseName(), $keys[3] => $this->getUserSurname(), $keys[4] => $this->getUserLogin(), $keys[5] => $this->getUserPass(), $keys[6] => $this->getUserPassIsTemp(), $keys[7] => $this->getRememberToken(), $keys[8] => $this->getUserEmail(), $keys[9] => $this->getUserPhone(), $keys[10] => $this->getUserAddress(), $keys[11] => $this->getRoleId(), $keys[12] => $this->getUserIsValidated(), $keys[13] => $this->getUserIsActive(), $keys[14] => $this->getUserPic(), $keys[15] => $this->getCreatedAt(), $keys[16] => $this->getUpdatedAt(), $keys_resource[1] => $this->getResourceType(), $keys_resource[2] => $this->getSocialViews(), $keys_resource[3] => $this->getSocialLikes(), $keys_resource[4] => $this->getSocialDislikes(), $keys_resource[5] => $this->getSocialComments(), $keys_resource[6] => $this->getSocialFavourites(), $keys_resource[7] => $this->getSocialRecommendations());
     if ($result[$keys[15]] instanceof \DateTime) {
         $result[$keys[15]] = $result[$keys[15]]->format('c');
     }
     if ($result[$keys[16]] instanceof \DateTime) {
         $result[$keys[16]] = $result[$keys[16]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aFile) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'file';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'file';
                     break;
                 default:
                     $key = 'File';
             }
             $result[$key] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aRole) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'role';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'role';
                     break;
                 default:
                     $key = 'Role';
             }
             $result[$key] = $this->aRole->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aResource) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResource->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->collOrders) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'orders';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'orders';
                     break;
                 default:
                     $key = 'Orders';
             }
             $result[$key] = $this->collOrders->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collSocialViews) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'socialViews';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'social_views';
                     break;
                 default:
                     $key = 'SocialViews';
             }
             $result[$key] = $this->collSocialViews->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collSocialLikes) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'socialLikes';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'social_likes';
                     break;
                 default:
                     $key = 'SocialLikes';
             }
             $result[$key] = $this->collSocialLikes->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collSocialComments) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'socialComments';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'social_comments';
                     break;
                 default:
                     $key = 'SocialComments';
             }
             $result[$key] = $this->collSocialComments->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collSocialRecommendationsRelatedByUserId) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'socialRecommendations';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'social_recommendations';
                     break;
                 default:
                     $key = 'SocialRecommendations';
             }
             $result[$key] = $this->collSocialRecommendationsRelatedByUserId->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collSocialRecommendationsRelatedBySocialRecommendationTo) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'socialRecommendations';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'social_recommendations';
                     break;
                 default:
                     $key = 'SocialRecommendations';
             }
             $result[$key] = $this->collSocialRecommendationsRelatedBySocialRecommendationTo->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collUserPeriodicPlans) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'userPeriodicPlans';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'user_periodic_plans';
                     break;
                 default:
                     $key = 'UserPeriodicPlans';
             }
             $result[$key] = $this->collUserPeriodicPlans->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collWishlists) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'wishlists';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'wishlists';
                     break;
                 default:
                     $key = 'Wishlists';
             }
             $result[$key] = $this->collWishlists->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
     }
     return $result;
 }
Example #4
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_CAMELNAME,
  *                    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['PeriodicPlan'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['PeriodicPlan'][$this->hashCode()] = true;
     $keys = PeriodicPlanTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getPeriodicPlanId(), $keys[1] => $this->getResourceId(), $keys[2] => $this->getPeriodicPlanName(), $keys[3] => $this->getPeriodicPlanPoint(), $keys[4] => $this->getPeriodicTypeId(), $keys[5] => $this->getDelieveryPeriodicWeekday(), $keys[6] => $this->getPeriodicPlanPic(), $keys[7] => $this->getCreatedAt(), $keys[8] => $this->getUpdatedAt());
     if ($result[$keys[7]] instanceof \DateTime) {
         $result[$keys[7]] = $result[$keys[7]]->format('c');
     }
     if ($result[$keys[8]] instanceof \DateTime) {
         $result[$keys[8]] = $result[$keys[8]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aResource) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResource->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aPeriodicType) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'periodicType';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'periodic_type';
                     break;
                 default:
                     $key = 'PeriodicType';
             }
             $result[$key] = $this->aPeriodicType->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aFile) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'file';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'file';
                     break;
                 default:
                     $key = 'File';
             }
             $result[$key] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->collDeliveryPeriodics) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'deliveryPeriodics';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'delivery_periodics';
                     break;
                 default:
                     $key = 'DeliveryPeriodics';
             }
             $result[$key] = $this->collDeliveryPeriodics->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collPeriodicPlanExceptions) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'periodicPlanExceptions';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'periodic_plan_exceptions';
                     break;
                 default:
                     $key = 'PeriodicPlanExceptions';
             }
             $result[$key] = $this->collPeriodicPlanExceptions->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collUserPeriodicPlans) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'userPeriodicPlans';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'user_periodic_plans';
                     break;
                 default:
                     $key = 'UserPeriodicPlans';
             }
             $result[$key] = $this->collUserPeriodicPlans->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
     }
     return $result;
 }
Example #5
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_CAMELNAME,
  *                    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['Category'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['Category'][$this->hashCode()] = true;
     $keys = CategoryTableMap::getFieldNames($keyType);
     $keys_resource = \App\Propel\Map\ResourceTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getCategoryId(), $keys[1] => $this->getResourceId(), $keys[2] => $this->getCategoryName(), $keys[3] => $this->getCategoryDescription(), $keys[4] => $this->getCategoryPic(), $keys[5] => $this->getCreatedAt(), $keys[6] => $this->getUpdatedAt(), $keys[7] => $this->getTreeLeft(), $keys[8] => $this->getTreeRight(), $keys[9] => $this->getTreeLevel(), $keys_resource[1] => $this->getResourceType(), $keys_resource[2] => $this->getSocialViews(), $keys_resource[3] => $this->getSocialLikes(), $keys_resource[4] => $this->getSocialDislikes(), $keys_resource[5] => $this->getSocialComments(), $keys_resource[6] => $this->getSocialFavourites(), $keys_resource[7] => $this->getSocialRecommendations());
     if ($result[$keys[5]] instanceof \DateTime) {
         $result[$keys[5]] = $result[$keys[5]]->format('c');
     }
     if ($result[$keys[6]] instanceof \DateTime) {
         $result[$keys[6]] = $result[$keys[6]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aResource) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResource->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aFile) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'file';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'file';
                     break;
                 default:
                     $key = 'File';
             }
             $result[$key] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->collProducts) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'products';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'products';
                     break;
                 default:
                     $key = 'Products';
             }
             $result[$key] = $this->collProducts->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
     }
     return $result;
 }
Example #6
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_CAMELNAME,
  *                    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['Provider'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['Provider'][$this->hashCode()] = true;
     $keys = ProviderTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getProviderId(), $keys[1] => $this->getResourceId(), $keys[2] => $this->getProviderName(), $keys[3] => $this->getProviderDescription(), $keys[4] => $this->getProviderIsOwn(), $keys[5] => $this->getProviderIsActive(), $keys[6] => $this->getProviderPic(), $keys[7] => $this->getCreatedAt(), $keys[8] => $this->getUpdatedAt());
     if ($result[$keys[7]] instanceof \DateTime) {
         $result[$keys[7]] = $result[$keys[7]]->format('c');
     }
     if ($result[$keys[8]] instanceof \DateTime) {
         $result[$keys[8]] = $result[$keys[8]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aResource) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResource->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aFile) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'file';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'file';
                     break;
                 default:
                     $key = 'File';
             }
             $result[$key] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->collProducts) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'products';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'products';
                     break;
                 default:
                     $key = 'Products';
             }
             $result[$key] = $this->collProducts->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
     }
     return $result;
 }
Example #7
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_CAMELNAME,
  *                    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['Product'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['Product'][$this->hashCode()] = true;
     $keys = ProductTableMap::getFieldNames($keyType);
     $keys_resource = \App\Propel\Map\ResourceTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getProductId(), $keys[1] => $this->getResourceId(), $keys[2] => $this->getProductName(), $keys[3] => $this->getProductDescription(), $keys[4] => $this->getCategoryId(), $keys[5] => $this->getProviderId(), $keys[6] => $this->getUnitId(), $keys[7] => $this->getProductRange(), $keys[8] => $this->getProductPrice(), $keys[9] => $this->getProductIsActive(), $keys[10] => $this->getProductPic(), $keys[11] => $this->getCreatedAt(), $keys[12] => $this->getUpdatedAt(), $keys_resource[1] => $this->getResourceType(), $keys_resource[2] => $this->getSocialViews(), $keys_resource[3] => $this->getSocialLikes(), $keys_resource[4] => $this->getSocialDislikes(), $keys_resource[5] => $this->getSocialComments(), $keys_resource[6] => $this->getSocialFavourites(), $keys_resource[7] => $this->getSocialRecommendations());
     if ($result[$keys[11]] instanceof \DateTime) {
         $result[$keys[11]] = $result[$keys[11]]->format('c');
     }
     if ($result[$keys[12]] instanceof \DateTime) {
         $result[$keys[12]] = $result[$keys[12]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aCategory) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'category';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'category';
                     break;
                 default:
                     $key = 'Category';
             }
             $result[$key] = $this->aCategory->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aProvider) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'provider';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'provider';
                     break;
                 default:
                     $key = 'Provider';
             }
             $result[$key] = $this->aProvider->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aUnit) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'unit';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'unit';
                     break;
                 default:
                     $key = 'Unit';
             }
             $result[$key] = $this->aUnit->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aFile) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'file';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'file';
                     break;
                 default:
                     $key = 'File';
             }
             $result[$key] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aResource) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'resource';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'resource';
                     break;
                 default:
                     $key = 'Resource';
             }
             $result[$key] = $this->aResource->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->collOrderProducts) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'orderProducts';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'order_products';
                     break;
                 default:
                     $key = 'OrderProducts';
             }
             $result[$key] = $this->collOrderProducts->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collProductHighlighteds) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'productHighlighteds';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'product_highlighteds';
                     break;
                 default:
                     $key = 'ProductHighlighteds';
             }
             $result[$key] = $this->collProductHighlighteds->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collProductVariationTypes) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'productVariationTypes';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'product_variation_types';
                     break;
                 default:
                     $key = 'ProductVariationTypes';
             }
             $result[$key] = $this->collProductVariationTypes->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
         if (null !== $this->collWishlistProducts) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'wishlistProducts';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'wishlist_products';
                     break;
                 default:
                     $key = 'WishlistProducts';
             }
             $result[$key] = $this->collWishlistProducts->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
         }
     }
     return $result;
 }