PHP Class Backend\Core\Engine\Meta

显示文件 Open project: forkcms/forkcms Class Usage Examples

Protected Properties

Property Type Description
$URL Url The URL-instance
$baseFieldName string The name of the field we should use to generate default-values
$callback array The callback method
$custom boolean Do we need meta custom
$data array The data, when a existing meta-record is loaded
$frm Form The form instance
$id integer The id, when an existing meta-record is loaded

Public Methods

Method Description
__construct ( Form $form, integer $metaId = null, string $baseFieldName = 'title', boolean $custom = false )
generateURL ( string $url ) : string Generate an url, using the predefined callback.
getData ( ) : array
getDescription ( ) : mixed Get the current value for the meta-description;
getDescriptionOverwrite ( ) : null | boolean Should the description overwrite the default
getId ( ) : null | integer Get the current value for the metaId;
getKeywords ( ) : mixed Get the current value for the meta-keywords;
getKeywordsOverwrite ( ) : null | boolean Should the keywords overwrite the default
getMetaEntity ( ) : Meta
getTitle ( ) : mixed Get the current value for the page title;
getTitleOverwrite ( ) : null | boolean Should the title overwrite the default
getURL ( ) : null | string Return the current value for an URL
getURLOverwrite ( ) : null | boolean Should the URL overwrite the default
save ( boolean $update = false ) : integer Saves the meta object
setURLCallback ( string $className, string $methodName, array $parameters = [] ) Set the callback to calculate an unique URL REMARK: this method has to be public and static REMARK: if you specify arguments they will be appended
validate ( ) Validates the form It checks if there is a value when a checkbox is checked

Protected Methods

Method Description
loadForm ( ) Add all element into the form
loadMeta ( integer $id ) Load a specific meta-record

Method Details

__construct() public method

public __construct ( Form $form, integer $metaId = null, string $baseFieldName = 'title', boolean $custom = false )
$form Form An instance of Form, the elements will be parsed in here.
$metaId integer The metaID to load.
$baseFieldName string The field where the URL should be based on.
$custom boolean Add/show custom-meta.

generateURL() public method

Generate an url, using the predefined callback.
Deprecation: use the generateUrl method on the meta repository
public generateURL ( string $url ) : string
$url string The base-url to start from.
return string

getData() public method

public getData ( ) : array
return array

getDescription() public method

Get the current value for the meta-description;
public getDescription ( ) : mixed
return mixed

getDescriptionOverwrite() public method

Should the description overwrite the default
public getDescriptionOverwrite ( ) : null | boolean
return null | boolean

getId() public method

Get the current value for the metaId;
public getId ( ) : null | integer
return null | integer

getKeywords() public method

Get the current value for the meta-keywords;
public getKeywords ( ) : mixed
return mixed

getKeywordsOverwrite() public method

Should the keywords overwrite the default
public getKeywordsOverwrite ( ) : null | boolean
return null | boolean

getMetaEntity() public method

public getMetaEntity ( ) : Meta
return Common\Doctrine\Entity\Meta

getTitle() public method

Get the current value for the page title;
public getTitle ( ) : mixed
return mixed

getTitleOverwrite() public method

Should the title overwrite the default
public getTitleOverwrite ( ) : null | boolean
return null | boolean

getURL() public method

Return the current value for an URL
public getURL ( ) : null | string
return null | string

getURLOverwrite() public method

Should the URL overwrite the default
public getURLOverwrite ( ) : null | boolean
return null | boolean

loadForm() protected method

Add all element into the form
protected loadForm ( )

loadMeta() protected method

Load a specific meta-record
protected loadMeta ( integer $id )
$id integer The id of the record to load.

save() public method

Saves the meta object
Deprecation: just use the entity for doctrine
public save ( boolean $update = false ) : integer
$update boolean Should we update the record or insert a new one.
return integer

setURLCallback() public method

Set the callback to calculate an unique URL REMARK: this method has to be public and static REMARK: if you specify arguments they will be appended
public setURLCallback ( string $className, string $methodName, array $parameters = [] )
$className string Name of the class to use.
$methodName string Name of the method to use.
$parameters array Parameters to parse, they will be passed after ours.

validate() public method

Validates the form It checks if there is a value when a checkbox is checked
public validate ( )

Property Details

$URL protected_oe property

The URL-instance
protected Url,Backend\Core\Engine $URL
return Url

$baseFieldName protected_oe property

The name of the field we should use to generate default-values
protected string $baseFieldName
return string

$callback protected_oe property

The callback method
protected array $callback
return array

$custom protected_oe property

Do we need meta custom
protected bool $custom
return boolean

$data protected_oe property

The data, when a existing meta-record is loaded
protected array $data
return array

$frm protected_oe property

The form instance
protected Form,Backend\Core\Engine $frm
return Form

$id protected_oe property

The id, when an existing meta-record is loaded
protected int $id
return integer