/** * 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['RFieldpostprocessorForfield'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['RFieldpostprocessorForfield'][$this->hashCode()] = true; $keys = RFieldpostprocessorForfieldTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getPostprocessorid(), $keys[1] => $this->getTemplateid()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aFieldpostprocessor) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'fieldpostprocessor'; break; case TableMap::TYPE_FIELDNAME: $key = '_fieldpostprocessor'; break; default: $key = 'Fieldpostprocessor'; } $result[$key] = $this->aFieldpostprocessor->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aTemplates) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'templates'; break; case TableMap::TYPE_FIELDNAME: $key = '_templates'; break; default: $key = 'Templates'; } $result[$key] = $this->aTemplates->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } } return $result; }
/** * 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['Data'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Data'][$this->hashCode()] = true; $keys = DataTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getForcontribution(), $keys[2] => $this->getFortemplatefield(), $keys[3] => $this->getContent(), $keys[4] => $this->getIsjson(), $keys[5] => $this->getUserSys(), $keys[6] => $this->getConfigSys(), $keys[7] => $this->getSplit(), $keys[8] => $this->getParentnode(), $keys[9] => $this->getSort()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->auserSysRef) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'users'; break; case TableMap::TYPE_FIELDNAME: $key = 'users'; break; default: $key = 'Users'; } $result[$key] = $this->auserSysRef->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aContributions) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'contributions'; break; case TableMap::TYPE_FIELDNAME: $key = '_contributions'; break; default: $key = 'Contributions'; } $result[$key] = $this->aContributions->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aTemplates) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'templates'; break; case TableMap::TYPE_FIELDNAME: $key = '_templates'; break; default: $key = 'Templates'; } $result[$key] = $this->aTemplates->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } } return $result; }