PHP Класс WhEditableSaver

Helps to update model by editable widget submit request.
Автор: Antonio Ramirez ([email protected])
Автор: Vitaliy Potapov ([email protected])
Наследование: extends CComponent
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$attribute mixed name of attribute to be updated
$errorHttpCode http status code returned in case of error
$model CActiveRecord model instance
$modelClass mixed name of model
$primaryKey mixed primaryKey value
$scenario mixed scenario used in model for update. Can be taken from scenario POST param
$value new value of attribute

Защищенные свойства (Protected)

Свойство Тип Описание
$changedAttributes mixed name of changed attributes. Used when saving model

Открытые методы

Метод Описание
__construct ( $modelClass ) : EditableBackend Constructor
checkErrors ( ) errors as CHttpException
error ( $msg ) errors as CHttpException
onAfterUpdate ( CEvent $event ) This event is raised after the update is performed.
onBeforeUpdate ( CModelEvent $event ) This event is raised before the update is performed.
setAttribute ( mixed $name, mixed $value ) setting new value of attribute.
update ( ) main function called to update column in database

Защищенные методы

Метод Описание
afterUpdate ( ) afterUpdate
beforeUpdate ( ) beforeUpdate

Описание методов

__construct() публичный Метод

Constructor
public __construct ( $modelClass ) : EditableBackend
Результат EditableBackend

afterUpdate() защищенный Метод

afterUpdate
protected afterUpdate ( )

beforeUpdate() защищенный Метод

beforeUpdate
protected beforeUpdate ( )

checkErrors() публичный Метод

errors as CHttpException
public checkErrors ( )

error() публичный Метод

errors as CHttpException
public error ( $msg )
$msg

onAfterUpdate() публичный Метод

This event is raised after the update is performed.
public onAfterUpdate ( CEvent $event )
$event CEvent the event parameter

onBeforeUpdate() публичный Метод

This event is raised before the update is performed.
public onBeforeUpdate ( CModelEvent $event )
$event CModelEvent the event parameter

setAttribute() публичный Метод

Attrubute name also stored in array to save only changed attributes
public setAttribute ( mixed $name, mixed $value )
$name mixed
$value mixed

update() публичный Метод

main function called to update column in database
public update ( )

Описание свойств

$attribute публичное свойство

name of attribute to be updated
public mixed $attribute
Результат mixed

$changedAttributes защищенное свойство

name of changed attributes. Used when saving model
protected mixed $changedAttributes
Результат mixed

$errorHttpCode публичное свойство

http status code returned in case of error
public $errorHttpCode

$model публичное свойство

model instance
public CActiveRecord $model
Результат CActiveRecord

$modelClass публичное свойство

name of model
public mixed $modelClass
Результат mixed

$primaryKey публичное свойство

primaryKey value
public mixed $primaryKey
Результат mixed

$scenario публичное свойство

scenario used in model for update. Can be taken from scenario POST param
public mixed $scenario
Результат mixed

$value публичное свойство

new value of attribute
public $value