PHP Interface ManaPHP\Mvc\Model\MetadataInterface

Show file Open project: manaphp/manaphp

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

Method Details

getAttributes() public method

Returns table attributes names (fields)
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

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

hasAttribute() public method

Check if a model has certain attribute
public hasAttribute ( string | ManaPHP\Mvc\ModelInterface $model, string $attribute ) : boolean
$model string | ManaPHP\Mvc\ModelInterface
$attribute string
return boolean