Deprectated method. #866

Closed
wants to merge 1 commit into
from
+0 −30
Split
@@ -381,36 +381,6 @@ public function item($model, array $data = array(), array $options = array()) {
}
/**
- * Casts data into proper format when added to a collection or entity object.
- *
- * @param mixed $entity The entity or collection for which data is being cast, or the name of
- * the model class to which the entity/collection is bound.
- * @param array $data An array of data being assigned.
- * @param array $options Any associated options with, for example, instantiating new objects in
- * which to wrap the data. Options implemented by `cast()` itself:
- * - `first` _boolean_: Used when only one value is passed to `cast()`. Even though
- * that value must be wrapped in an array, setting the `'first'` option to `true`
- * causes only that one value to be returned.
- * @return mixed Returns the value of `$data`, cast to the proper format according to the schema
- * definition of the model class specified by `$model`.
- */
- public function cast($entity, array $data, array $options = array()) {
- $defaults = array('pathKey' => null, 'model' => null);
- $options += $defaults;
- $model = $options['model'] ?: $entity->model();
-
- foreach ($data as $key => $val) {
- if (!is_array($val)) {
- continue;
- }
- $pathKey = $options['pathKey'] ? "{$options['pathKey']}.{$key}" : $key;
- $class = (range(0, count($val) - 1) === array_keys($val)) ? 'set' : 'entity';
- $data[$key] = $this->item($model, $val, compact('class', 'pathKey') + $options);
- }
- return parent::cast($entity, $data, $options);
- }
-
- /**
* Handle conditions.
*
* @param string $conditions