PHP Class ManaPHP\Mvc\Model\Metadata

Inheritance: extends ManaPHP\Component, implements ManaPHP\Mvc\Model\MetadataInterface, implements ManaPHP\Mvc\Model\Metadata\AdapterInterface
Show file Open project: manaphp/manaphp

Protected Properties

Property Type Description
$_metadata array

Public Methods

Method Description
getAttributes ( string | ManaPHP\Mvc\ModelInterface $model ) : array Returns table attributes names (fields)
getAutoIncrementAttribute ( string | ManaPHP\Mvc\ModelInterface $model ) : string | null Returns attribute which is auto increment or null
getColumnProperties ( string | ManaPHP\Mvc\ModelInterface $model ) : array
getNonPrimaryKeyAttributes ( string | ManaPHP\Mvc\ModelInterface $model ) : array Returns an array of fields which are not part of the primary key
getPrimaryKeyAttributes ( string | ManaPHP\Mvc\ModelInterface $model ) : array Returns an array of fields which are part of the primary key
hasAttribute ( string | ManaPHP\Mvc\ModelInterface $model, string $attribute ) : boolean Check if a model has certain attribute

Protected Methods

Method Description
_readMetaData ( string | ManaPHP\Mvc\ModelInterface $model ) : array Reads the complete meta-data for certain model

Method Details

_readMetaData() protected method

print_r($metaData->readMetaData(new Robots()));
protected _readMetaData ( string | ManaPHP\Mvc\ModelInterface $model ) : array
$model string | ManaPHP\Mvc\ModelInterface
return array

getAttributes() public method

print_r($metaData->getAttributes(new Robots()));
public getAttributes ( string | ManaPHP\Mvc\ModelInterface $model ) : array
$model string | ManaPHP\Mvc\ModelInterface
return array

getAutoIncrementAttribute() public method

Returns attribute which is auto increment or null
public getAutoIncrementAttribute ( string | ManaPHP\Mvc\ModelInterface $model ) : string | null
$model string | ManaPHP\Mvc\ModelInterface
return string | null |null

getColumnProperties() public method

public getColumnProperties ( string | ManaPHP\Mvc\ModelInterface $model ) : array
$model string | ManaPHP\Mvc\ModelInterface
return array

getNonPrimaryKeyAttributes() public method

Returns an array of fields which are not part of the primary key
public getNonPrimaryKeyAttributes ( string | ManaPHP\Mvc\ModelInterface $model ) : array
$model string | ManaPHP\Mvc\ModelInterface
return array

getPrimaryKeyAttributes() public method

print_r($metaData->getPrimaryKeyAttributes(new Robots()));
public getPrimaryKeyAttributes ( string | ManaPHP\Mvc\ModelInterface $model ) : array
$model string | ManaPHP\Mvc\ModelInterface
return array

hasAttribute() public method

var_dump($metaData->hasAttribute(new Robots(), 'name'));
public hasAttribute ( string | ManaPHP\Mvc\ModelInterface $model, string $attribute ) : boolean
$model string | ManaPHP\Mvc\ModelInterface
$attribute string
return boolean

Property Details

$_metadata protected property

protected array $_metadata
return array