Transform the \Day entity
@param \Day $model

@return array
345442
public function transform(Day $model)
    {
        return [
            'id'         => (int) $model->id,

            /* place your other model properties here */

            'created_at' => $model->created_at,
            'updated_at' => $model->updated_at
        ];
    }
350131
public function referencing(Model $model)
    {
        $references = [];

        // TODO: SchemaManager should do this
        foreach ($this->schemas as $schema) {
            $references = array_merge($references, $schema->referencing($model->getBlueprint()));
        }

        // TODO: ModelManager should do this
        foreach ($references as &$related) {
            $blueprint = $related['blueprint'];
            $related['model'] = $model->getBlueprint()->is($blueprint->schema(), $blueprint->table())
                ? $model
                : $this->makeModel($blueprint->schema(), $blueprint->table(), false);
        }

        return $references;
    }
1043213
public function prepareCacheData(AbstractModel $model)
    {
        /**
         * @todo change MySQLTableData to a usecase based one
         */
        $tableData  = clone $this->tableData;
        $reflection = new \ReflectionClass($model);
        $tableData->setTableName($this->parseTableName($reflection));

        return [
            'tableData'    => $tableData,
            'reflection'   => new \ReflectionClass($model),
            'relationList' => $this->extractRelations($reflection),
        ];
    }
894593
public function transform($model)
    {
        if (is_array($model)) {
            return $model;
        }

        if ($model instanceof Collection) {
            return $model->toArray();
        }

        if ($model instanceof JsonSerializable) {
            return $model->jsonSerialize();
        }

        if ($model instanceof \stdClass) {
            return (array) $model;
        }

        throw new \Exception(
            'Expecting an instance of \Illuminate\Support\Collection, '
            . get_class($model)
            . ' given.'
        );
    }
769457
protected function _getAliases(Model $Model) {
		$aliases = array_merge(array(
			//$Model->name,
			$Model->alias
				), $this->config[$Model->alias]['aliases']
		);

		foreach ($Model->associations() as $associationType) {
			foreach ($Model->$associationType as $associationKey => $association) {
				if ($association['className'] === $Model->name) {
					$aliases[] = $associationKey;
				}
			}
		}

		return $aliases;
	}
694699
public function getTransformedFiles(Model $model) {
        if (isset($this->_uploads[$model->alias])) {
            return $this->_uploads[$model->alias]->getTransformedFiles();
        }

        return array();
    }
58640
protected function _normalizeModel(&$model) {
        if ($model instanceof Garp_Model_Db) {
            $model = get_class($model);
        }
        $model = strpos($model, 'Model_') !== false ? $model : 'Model_' . $model;
    }
1243932
protected function getDays() {
        if (!$this->_days) {
            $this->_days = new DayList($this->version, $this->solution['resourceType']);
        }

        return $this->_days;
    }
1131969
public function apply(Value $value): array
    {
        if ($value->isEmpty()) {
            return $this->null();
        }

        try {
            return $this->filtered(new Day($value->value()));
        } catch (\InvalidArgumentException $iae) {
            return $this->error('DATE_INVALID');
        }
    }
719437
protected function _removeAliases($fields, $model)
    {
        $result = [];
        foreach ($fields as $field => $sort) {
            if (strpos($field, '.') === false) {
                $result[$field] = $sort;
                continue;
            }

            list ($alias, $currentField) = explode('.', $field);

            if ($alias === $model) {
                $result[$currentField] = $sort;
                continue;
            }

            $result[$field] = $sort;
        }

        return $result;
    }
169131
private function getForeignKeyForNewAssociation(Model $model)
	{
		$this->setKeys($model);
		$primaryKey = Inflector::instance()->variablize($this->foreignKey[0]);

		return array(
			$primaryKey => $model->id,
		);
	}
107959
protected function _generateTableColumns($model)
    {
        $model = TableRegistry::get($model);
        $columns = ConnectionManager::get('default')->schemaCollection()->describe($model->table())->columns();

        $result = [];
        $counter = 0;
        $max = 2;

        if (in_array('id', $columns)) {
            $result['id'] = [];
            unset($columns['id']);
        }

        foreach ($columns as $column) {
            if ($counter < $max) {
                $result[$column] = [];
                unset($columns[$column]);
                $counter++;
            }
        }

        if (in_array('created', $columns)) {
            $result['created'] = [];
        }

        return $result;
    }
913330
public function getFields($model)
    {
        //
        $table = $this->getTable($model);

        //
        $sql = "DESC `{$table}`";

        //
        $results = $this->getResults($sql);

        //
        $fields = [];

        //
        foreach ($results as $field) {
            $fields[] = $field['Field'];
        }

        //
        return $fields;
    }
1267408
public function transform(Did $did)
    {
        return [
            'id'    => $did->id,
            'text'  => $did->text,
            'created_at' => $did->created_at->toIso8601String()
        ];
    }
1176849
function transform($models)
    {
        if($this instanceof SharpForm || $this instanceof Command) {
            // It's a Form (full entity or from a Command), there's only one model.
            // We must add Form Field Formatters in the process
            return $this->applyFormatters(
                $this->applyTransformers($models)
            );
        }

        // SharpEntityList case

        if($models instanceof LengthAwarePaginatorContract) {
            return new LengthAwarePaginator(
                $this->transform($models->items()),
                $models->total(),
                $models->perPage(),
                $models->currentPage()
            );
        }

        return collect($models)
            ->map(function($model) {
                return $this->applyTransformers($model);
            })
            ->all();
    }
205417
public function transform($weeklyPattern)
    {
        if (null === $weeklyPattern) {
            return null;
        }

        $selectedDays = array_filter(str_split($weeklyPattern), function ($value) {
            return $value == 1;
        });

        return array_keys($selectedDays);
    }
385439
protected function modifyDay( $day )
	{
		$classes	= array();
		if( (int)$this->getOption( 'show_day' ) == $day )
			$classes[]	= 'shown';
		if( in_array( $day, $this->events ) )
		{
			$url	= $this->getOption( 'url' );
			$url	.= "&".$this->getOption( 'carrier_year' )."=".$this->getOption( 'show_year' );
			$url	.= "&".$this->getOption( 'carrier_month' )."=".$this->getOption( 'show_month' );
			$url	.= "&".$this->getOption( 'carrier_day' )."=".$day;
			$day	= $this->html->Link( $url, $day );
			$classes[]	= 'event';
		}
		$class	= implode( ' ', $classes );
		return $data	= array( 'day'	=> $day, 'class' => $class );		
	}