Exemple #1
0
 /**
  *	Perform model specific array transformation
  */
 protected static function &transformArray($array, ARSchema $schema)
 {
     if (!empty($array['ID'])) {
         $id = 'raw-' . $schema->getName() . '-' . self::getRecordHash($array['ID']);
         self::$toArrayData[$id] =& $array;
         return self::$toArrayData[$id];
     }
     return $array;
 }
 public static function transformArray($array, ARSchema $schema)
 {
     unset($array[call_user_func(array($schema->getName(), 'getOwnerClass'))]);
     unset($array[call_user_func(array($schema->getName(), 'getFieldClass'))]);
     return MultiLingualObject::transformArray($array, $schema);
 }
Exemple #3
0
 protected static function transformArray($array, ARSchema $schema)
 {
     $schemaName = $schema->getName();
     foreach ($schema->getFieldsByType('ARDateTime') as $name => $field) {
         if (isset($array[$name])) {
             $time = strtotime($array[$name]);
             if (!$time) {
                 continue;
             }
             if (!isset($locale)) {
                 $locale = self::getApplication()->getLocale();
             }
             $array['formatted_' . $name] = $locale->getFormattedTime($time);
         }
     }
     $data = parent::transformArray($array, $schema);
     $data['__class__'] = $schemaName;
     if (self::isEav($schemaName)) {
         self::addToEavQueue($schemaName, $data);
     }
     try {
         self::executePlugins($data, 'array', $schemaName);
     } catch (Exception $e) {
         die($e->getMessage() . ' (' . __LINE__);
     }
     return $data;
 }