PHP 클래스 BaseActiveRecord

Currently its only purpose is to remove all html tags to prevent XSS.
상속: extends CActiveRecord
파일 보기 프로젝트 열기: openeyes/openeyes 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$auto_update_relations (whilst developing this feature, will allow other elements to continue to work)
$originalAttributes
$relation_defaults to be set when setting the left or right attribute of owning record.

공개 메소드들

메소드 설명
NHSDate ( string $attribute, string $empty_string = '-' ) : string Returns a date field in NHS format.
NHSDateAsHTML ( $attribute, string $empty_string = '-' ) : string
__set ( string $name, mixed $value ) : mixed | void If an array of arrays is passed for a HAS_MANY relation attribute, will create appropriate objects to assign to the attribute. Sets up the afterSave method to saves these objects if they have validated.
audit ( $target, $action, null $data = null, null $log_message = null, array $properties = [] )
canAutocomplete ( )
cloneObject ( $object, array $params = [] ) : mixed
getAutocompleteField ( )
getCleanAttribute ( $attrName ) : string Gets the clean version of an attribute, returns empty string if there was no clean version.
getRelationsDefaults ( $name ) : array Convenience method wrapper on the relation defaults property.
getShortModelName ( ) : string Shortened name of this model class, useful for namespaced modules.
isAttributeDirty ( $attrName ) : boolean Checks if an attribute is dirty.
isModelDirty ( ) : boolean Check if the model dirty.
model ( string $class_name = null ) Override to use LSB.
save ( boolean $runValidation = true, array $attributes = null, boolean $allow_overriding = false ) : boolean
saveOnlyIfDirty ( boolean $enable = true ) : BaseActiveRecord Set the flag to indicate that model should only save to the db if the model is dirty.
tableName ( ) : string Default to the lower case of the class to match naming convention for model tables.
textWithLineBreaks ( $field ) : mixed

보호된 메소드들

메소드 설명
afterFind ( ) Stores the data in an array afterFind so when saving we can check if the value is dirty or not.
afterSave ( ) Saves related objects now that we have a pk for the instance.
beforeDelete ( ) : boolean Iterate through relations and remove the records that will break constraints.
beforeSave ( ) : boolean Strips all html tags out of attributes to be saved.
setDefaultAdmissionTime ( $admissionTime, $startTime ) : boolean | string Sets the default admission time.

비공개 메소드들

메소드 설명
afterSaveHasMany ( $name, $rel, $new_objs, $orig_objs ) Save objects to the given relation.
afterSaveManyMany ( $name, CManyManyRelation $rel, $new_objs, $orig_objs )
afterSaveThruHasMany ( $name, $rel, $thru, $new_objs ) Save the given objects for the through relation.

메소드 상세

NHSDate() 공개 메소드

Returns a date field in NHS format.
public NHSDate ( string $attribute, string $empty_string = '-' ) : string
$attribute string
$empty_string string - what to return if not able to convert
리턴 string

NHSDateAsHTML() 공개 메소드

public NHSDateAsHTML ( $attribute, string $empty_string = '-' ) : string
$attribute
$empty_string string
리턴 string

__set() 공개 메소드

NOTE once a property is set, this magic method will not be called by php for setting it again, unless the property is unset first.
public __set ( string $name, mixed $value ) : mixed | void
$name string
$value mixed
리턴 mixed | void

afterFind() 보호된 메소드

Stores the data in an array afterFind so when saving we can check if the value is dirty or not.
protected afterFind ( )

afterSave() 보호된 메소드

Saves related objects now that we have a pk for the instance.
protected afterSave ( )

audit() 공개 메소드

public audit ( $target, $action, null $data = null, null $log_message = null, array $properties = [] )
$target
$action
$data null
$log_message null
$properties array

beforeDelete() 보호된 메소드

Iterate through relations and remove the records that will break constraints.
protected beforeDelete ( ) : boolean
리턴 boolean

beforeSave() 보호된 메소드

Strips all html tags out of attributes to be saved.
protected beforeSave ( ) : boolean
리턴 boolean

canAutocomplete() 공개 메소드

public canAutocomplete ( )

cloneObject() 공개 정적인 메소드

public static cloneObject ( $object, array $params = [] ) : mixed
$object
$params array
리턴 mixed

getAutocompleteField() 공개 메소드

getCleanAttribute() 공개 메소드

Gets the clean version of an attribute, returns empty string if there was no clean version.
public getCleanAttribute ( $attrName ) : string
$attrName
리턴 string

getRelationsDefaults() 공개 메소드

Convenience method wrapper on the relation defaults property.
public getRelationsDefaults ( $name ) : array
$name
리턴 array

getShortModelName() 공개 정적인 메소드

Shortened name of this model class, useful for namespaced modules.
public static getShortModelName ( ) : string
리턴 string

isAttributeDirty() 공개 메소드

Checks if an attribute is dirty.
public isAttributeDirty ( $attrName ) : boolean
$attrName
리턴 boolean

isModelDirty() 공개 메소드

Check if the model dirty.
public isModelDirty ( ) : boolean
리턴 boolean true if the model dirty

model() 공개 정적인 메소드

Override to use LSB.
public static model ( string $class_name = null )
$class_name string

save() 공개 메소드

public save ( boolean $runValidation = true, array $attributes = null, boolean $allow_overriding = false ) : boolean
$runValidation boolean
$attributes array
$allow_overriding boolean - if true allows created/modified user/date to be set and saved via the model (otherwise gets overriden)
리턴 boolean

saveOnlyIfDirty() 공개 메소드

Set the flag to indicate that model should only save to the db if the model is dirty.
public saveOnlyIfDirty ( boolean $enable = true ) : BaseActiveRecord
$enable boolean
리턴 BaseActiveRecord

setDefaultAdmissionTime() 보호된 메소드

If there is no default admission time supplied it should be set before one hour before the start time, used for sequences and sessions in OphTrOperationbooking.
protected setDefaultAdmissionTime ( $admissionTime, $startTime ) : boolean | string
$admissionTime
$startTime
리턴 boolean | string

tableName() 공개 메소드

Default to the lower case of the class to match naming convention for model tables.
public tableName ( ) : string
리턴 string

textWithLineBreaks() 공개 메소드

public textWithLineBreaks ( $field ) : mixed
$field
리턴 mixed

프로퍼티 상세

$auto_update_relations 보호되어 있는 프로퍼티

(whilst developing this feature, will allow other elements to continue to work)
protected $auto_update_relations

$originalAttributes 보호되어 있는 프로퍼티

protected $originalAttributes

$relation_defaults 보호되어 있는 프로퍼티

to be set when setting the left or right attribute of owning record.
protected $relation_defaults