PHP Класс TbEditableSaver

Наследование: 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 scenarion used in model for update
$value new value of attribute

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

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

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

Метод Описание
__construct ( $modelClass ) : TbEditableSaver ### ._construct()
checkErrors ( ) ### .checkErros()
error ( $msg ) ### .error()
onAfterUpdate ( CEvent $event ) ### .onAfterUpdate()
onBeforeUpdate ( CModelEvent $event ) ### .onBeforeUpdate()
setAttribute ( mixed $name, mixed $value ) ### .setAttribute()
update ( ) ### .update()

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

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

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

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

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

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() публичный Метод

setting new value of attribute. 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 публичное свойство

scenarion used in model for update
public mixed $scenario
Результат mixed

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

new value of attribute
public $value