PHP Class skeeks\cms\relatedProperties\models\RelatedPropertiesModel

Inheritance: extends yii\base\DynamicModel
Show file Open project: skeeks-cms/cms Class Usage Examples

Public Properties

Property Type Description
$relatedElementModel RelatedElementModel

Public Methods

Method Description
attributeHints ( ) : array
attributeLabels ( )
delete ( ) : boolean
getAttribute ( string $name ) : mixed Returns the named attribute value.
getEnumByAttribute ( $name ) : RelatedPropertyEnumModel | RelatedPropertyEnumModel[] | null
getProperties ( ) : RelatedPropertyModel[]
getRelatedElementProperties ( string $name ) : RelatedElementPropertyModel | RelatedElementPropertyModel[]
getRelatedProperty ( string $name ) : RelatedPropertyModel
getSmartAttribute ( $name ) : string
hasAttribute ( string $name ) : boolean Returns a value indicating whether the model has an attribute with the specified name.
init ( )
loadDefaultValues ( boolean $skipIfSet = true ) Loads default values from database table schema
save ( boolean $runValidation = true, array $attributeNames = null ) : boolean Saves the current record.
setAttribute ( string $name, mixed $value ) Sets the named attribute value.

Protected Methods

Method Description
_deleteRelatedPropertyValue ( RelatedPropertyModel $property )
_saveRelatedPropertyValue ( RelatedPropertyModel $property )

Method Details

_deleteRelatedPropertyValue() protected method

protected _deleteRelatedPropertyValue ( RelatedPropertyModel $property )
$property RelatedPropertyModel

_saveRelatedPropertyValue() protected method

protected _saveRelatedPropertyValue ( RelatedPropertyModel $property )
$property RelatedPropertyModel

attributeHints() public method

public attributeHints ( ) : array
return array

attributeLabels() public method

public attributeLabels ( )

delete() public method

public delete ( ) : boolean
return boolean

getAttribute() public method

If this record is the result of a query and the attribute is not loaded, null will be returned.
See also: hasAttribute()
public getAttribute ( string $name ) : mixed
$name string the attribute name
return mixed the attribute value. Null if the attribute is not set or does not exist.

getEnumByAttribute() public method

public getEnumByAttribute ( $name ) : RelatedPropertyEnumModel | RelatedPropertyEnumModel[] | null
$name
return RelatedPropertyEnumModel | RelatedPropertyEnumModel[] | null

getProperties() public method

public getProperties ( ) : RelatedPropertyModel[]
return RelatedPropertyModel[]

getRelatedElementProperties() public method

public getRelatedElementProperties ( string $name ) : RelatedElementPropertyModel | RelatedElementPropertyModel[]
$name string
return RelatedElementPropertyModel | RelatedElementPropertyModel[]

getRelatedProperty() public method

public getRelatedProperty ( string $name ) : RelatedPropertyModel
$name string
return RelatedPropertyModel

getSmartAttribute() public method

public getSmartAttribute ( $name ) : string
$name
return string

hasAttribute() public method

Returns a value indicating whether the model has an attribute with the specified name.
public hasAttribute ( string $name ) : boolean
$name string the name of the attribute
return boolean whether the model has an attribute with the specified name.

init() public method

public init ( )

loadDefaultValues() public method

You may call this method to load default values after creating a new instance: php class Customer extends \yii\db\ActiveRecord $customer = new Customer(); $customer->loadDefaultValues();
public loadDefaultValues ( boolean $skipIfSet = true )
$skipIfSet boolean whether existing value should be preserved. This will only set defaults for attributes that are `null`.

save() public method

This method will call [[insert()]] when [[isNewRecord]] is true, or [[update()]] when [[isNewRecord]] is false. For example, to save a customer record: php $customer = new Customer; // or $customer = Customer::findOne($id); $customer->name = $name; $customer->email = $email; $customer->save();
public save ( boolean $runValidation = true, array $attributeNames = null ) : boolean
$runValidation boolean whether to perform validation (calling [[validate()]]) before saving the record. Defaults to `true`. If the validation fails, the record will not be saved to the database and this method will return `false`.
$attributeNames array list of attribute names that need to be saved. Defaults to null, meaning all attributes that are loaded from DB will be saved.
return boolean whether the saving succeeded (i.e. no validation errors occurred).

setAttribute() public method

Sets the named attribute value.
See also: hasAttribute()
public setAttribute ( string $name, mixed $value )
$name string the attribute name
$value mixed the attribute value.

Property Details

$relatedElementModel public property

public RelatedElementModel $relatedElementModel
return RelatedElementModel