Class Socialveo\Core\behaviors\CustomFieldsBehavior

InheritanceSocialveo\Core\behaviors\CustomFieldsBehavior » Phalcon\Mvc\Model\Behavior
ImplementsPhalcon\Mvc\Model\BehaviorInterface

Class CustomFieldsBehavior

Property Details

$config protected property
protected array $config null
$fields protected property
protected array $fields = []
$fieldsAvailable protected property
protected array $fieldsAvailable = []
$relation protected property

Method Details

__construct() public method

CustomFieldsBehavior constructor.

public void __construct ( $options null )
$options array|null

[optional]

throws Exception
afterFetch() public method

Fetch custom fields after saving parent model

public void afterFetch ( $model )
$model Socialveo\Core\models\SocialveoModel
afterSave() public method

Save custom fields after saving parent model

public void afterSave ( $model )
$model Socialveo\Core\models\SocialveoModel
throws Exception
beforeSave() public method

Save custom fields to model properties

public void beforeSave ( $model )
$model Socialveo\Core\models\Network
throws Exception
findRelation() protected method

Find relation

protected Phalcon\Mvc\Model|Socialveo\Core\models\CustomFields findRelation ( $model, $type null )
$model Socialveo\Core\models\SocialveoModel
$type string

[optional]

getCustomFields() public method

Get custom fields relation

public Socialveo\Core\models\CustomFields getCustomFields ( $model, $attribute null )
$model Socialveo\Core\models\Network
$attribute null

[ignored]

getCustomFieldsSource() public method

Returns source table of custom fields

public string getCustomFieldsSource ( $type )
$type string
getCustomFieldsType() public method

Return custom fields type

public string getCustomFieldsType ( $model )
$model Socialveo\Core\models\SocialveoModel
getNetworkId() protected method

Get network id

protected mixed getNetworkId ( $model )
$model
getter() public method

Magic method for getting custom fields

public mixed getter ( $model, $attribute )
$model Socialveo\Core\models\SocialveoModel
$attribute string
initialize() public method

Init custom fields

public void initialize ( $model )
$model
throws Exception
isSupport() protected method

Check whether model is supports custom fields

protected boolean isSupport ( $model )
$model Socialveo\Core\models\SocialveoModel
missingMethod() public method

Acts as fallback when a missing method is called on the model

public null|void missingMethod ( Phalcon\Mvc\ModelInterface $model, $method, $arguments null )
$model Phalcon\Mvc\ModelInterface|Socialveo\Core\models\SocialveoModel
$method string
$arguments array

[optional]

modelOnConstruct() public method

On model construct

public void modelOnConstruct ( $model )
$model Socialveo\Core\models\SocialveoModel
notify() public method

Delegates events

public mixed|void notify ( $eventType, Phalcon\Mvc\ModelInterface $model )
$eventType string
$model Phalcon\Mvc\ModelInterface|Socialveo\Core\models\SocialveoModel
setter() public method

Magic method for setting custom fields

public void setter ( $model, $value, $attribute )
$model Socialveo\Core\models\SocialveoModel
$value mixed
$attribute string
toJson() public method

Convert to json

public array toJson ( $model )
$model Socialveo\Core\models\SocialveoModel|Socialveo\Core\models\Network
validation() public method

Register custom fields validators defined in config

public void validation ( $model )
$model Socialveo\Core\models\SocialveoModel
throws Exception