PiiFile
Package | pii.core.file |
---|---|
Inheritance | class PiiFile » CActiveRecord » CModel » CComponent |
Implements | IteratorAggregate, Traversable, ArrayAccess |
Since | 2.0 |
Version | $Id$ |
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
attributes | array | Returns all column attribute values. | CActiveRecord |
commandBuilder | CDbCommandBuilder | the command builder used by this AR | CActiveRecord |
db | CDbConnection | the default database connection for all active record classes. | CActiveRecord |
dbConnection | CDbConnection | Returns the database connection used by active record. | CActiveRecord |
dbCriteria | CDbCriteria | Returns the query criteria associated with this model. | CActiveRecord |
errors | array | Returns the errors for all attribute or a single attribute. | CModel |
fileList | PiiFile | ||
isNewRecord | boolean | whether the record is new and should be inserted when calling save. | CActiveRecord |
iterator | CMapIterator | Returns an iterator for traversing the attributes in the model. | CModel |
metaData | CActiveRecordMetaData | the meta for this AR class. | CActiveRecord |
oldPrimaryKey | mixed | Returns the old primary key value. | CActiveRecord |
primaryKey | mixed | the primary key value. | CActiveRecord |
safeAttributeNames | array | Returns the attribute names that are safe to be massively assigned. | CModel |
scenario | string | Returns the scenario that this model is used in. | CModel |
tableSchema | CDbTableSchema | the metadata of the table that this AR belongs to | CActiveRecord |
validators | array | Returns the validators applicable to the current scenario. | CModel |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | CActiveRecord |
__construct() | Constructor. | CActiveRecord |
__get() | PHP getter magic method. | CActiveRecord |
__isset() | Checks if a property value is null. | CActiveRecord |
__set() | PHP setter magic method. | CActiveRecord |
__sleep() | PHP sleep magic method. | CActiveRecord |
__unset() | Sets a component property to be null. | CActiveRecord |
addError() | Adds a new error to the specified attribute. | CModel |
addErrors() | Adds a list of errors. | CModel |
addRelatedRecord() | Adds a related object to this record. | CActiveRecord |
afterFindInternal() | Calls afterFind. | CActiveRecord |
asa() | Returns the named behavior object. | CComponent |
attachBehavior() | Attaches a behavior to this component. | CComponent |
attachBehaviors() | Attaches a list of behaviors to the component. | CComponent |
attachEventHandler() | Attaches an event handler to an event. | CComponent |
attributeLabels() | PiiFile | |
attributeNames() | Returns the list of all attribute names of the model. | CActiveRecord |
behaviors() | PiiFile | |
canGetProperty() | Determines whether a property can be read. | CComponent |
canSetProperty() | Determines whether a property can be set. | CComponent |
clearErrors() | Removes errors for all attributes or a single attribute. | CModel |
count() | Finds the number of rows satisfying the specified query condition. | CActiveRecord |
countBySql() | Finds the number of rows using the given SQL statement. | CActiveRecord |
createValidators() | Creates validator objects based on the specification in rules. | CModel |
defaultScope() | Returns the default named scope that should be implicitly applied to all queries for this model. | CActiveRecord |
delete() | Deletes the row corresponding to this active record. | CActiveRecord |
deleteAll() | Deletes rows with the specified condition. | CActiveRecord |
deleteAllByAttributes() | Deletes rows which match the specified attribute values. | CActiveRecord |
deleteByPk() | Deletes rows with the specified primary key. | CActiveRecord |
detachBehavior() | Detaches a behavior from the component. | CComponent |
detachBehaviors() | Detaches all behaviors from the component. | CComponent |
detachEventHandler() | Detaches an existing event handler. | CComponent |
disableBehavior() | Disables an attached behavior. | CComponent |
disableBehaviors() | Disables all behaviors attached to this component. | CComponent |
enableBehavior() | Enables an attached behavior. | CComponent |
enableBehaviors() | Enables all behaviors attached to this component. | CComponent |
equals() | Compares this active record with another one. | CActiveRecord |
exists() | Checks whether there is row satisfying the specified condition. | CActiveRecord |
find() | Finds a single active record with the specified condition. | CActiveRecord |
findAll() | Finds all active records satisfying the specified condition. | CActiveRecord |
findAllByAttributes() | Finds all active records that have the specified attribute values. | CActiveRecord |
findAllByPk() | Finds all active records with the specified primary keys. | CActiveRecord |
findAllBySql() | Finds all active records using the specified SQL statement. | CActiveRecord |
findByAttributes() | Finds a single active record that has the specified attribute values. | CActiveRecord |
findByPk() | Finds a single active record with the specified primary key. | CActiveRecord |
findBySql() | Finds a single active record with the specified SQL statement. | CActiveRecord |
generateAttributeLabel() | Generates a user friendly attribute label. | CModel |
getActiveRelation() | CActiveRecord | |
getAttribute() | Returns the named attribute value. | CActiveRecord |
getAttributeLabel() | Returns the text label for the specified attribute. | CModel |
getAttributes() | Returns all column attribute values. | CActiveRecord |
getCommandBuilder() | CActiveRecord | |
getDbConnection() | Returns the database connection used by active record. | CActiveRecord |
getDbCriteria() | Returns the query criteria associated with this model. | CActiveRecord |
getError() | Returns the first error of the specified attribute. | CModel |
getErrors() | Returns the errors for all attribute or a single attribute. | CModel |
getEventHandlers() | Returns the list of attached event handlers for an event. | CComponent |
getFileList() | PiiFile | |
getIsNewRecord() | CActiveRecord | |
getIterator() | Returns an iterator for traversing the attributes in the model. | CModel |
getMetaData() | CActiveRecord | |
getOldPrimaryKey() | Returns the old primary key value. | CActiveRecord |
getPrimaryKey() | CActiveRecord | |
getRelated() | Returns the related record(s). | CActiveRecord |
getSafeAttributeNames() | Returns the attribute names that are safe to be massively assigned. | CModel |
getScenario() | Returns the scenario that this model is used in. | CModel |
getTableSchema() | CActiveRecord | |
getValidators() | Returns the validators applicable to the current scenario. | CModel |
hasAttribute() | CActiveRecord | |
hasErrors() | Returns a value indicating whether there is any validation error. | CModel |
hasEvent() | Determines whether an event is defined. | CComponent |
hasEventHandler() | Checks whether the named event has attached handlers. | CComponent |
hasProperty() | Determines whether a property is defined. | CComponent |
hasRelated() | Returns a value indicating whether the named related object(s) has been loaded. | CActiveRecord |
image() | PiiFile | |
init() | Initializes this model. | CActiveRecord |
insert() | Inserts a row into the table based on this active record attributes. | CActiveRecord |
isAttributeRequired() | Returns a value indicating whether the attribute is required. | CModel |
isAttributeSafe() | Returns a value indicating whether the attribute is safe for massive assignments. | CModel |
model() | Returns the static model of the specified AR class. | PiiFile |
offsetExists() | Returns whether there is an element at the specified offset. | CActiveRecord |
offsetGet() | Returns the element at the specified offset. | CModel |
offsetSet() | Sets the element at the specified offset. | CModel |
offsetUnset() | Unsets the element at the specified offset. | CModel |
onAfterConstruct() | This event is raised after the record instance is created by new operator. | CActiveRecord |
onAfterDelete() | This event is raised after the record is deleted. | CActiveRecord |
onAfterFind() | This event is raised after the record is instantiated by a find method. | CActiveRecord |
onAfterSave() | This event is raised after the record is saved. | CActiveRecord |
onAfterValidate() | This event is raised after the validation is performed. | CModel |
onBeforeDelete() | This event is raised before the record is deleted. | CActiveRecord |
onBeforeFind() | This event is raised before an AR finder performs a find call. | CActiveRecord |
onBeforeSave() | This event is raised before the record is saved. | CActiveRecord |
onBeforeValidate() | This event is raised before the validation is performed. | CModel |
populateRecord() | Creates an active record with the given attributes. | CActiveRecord |
populateRecords() | Creates a list of active records based on the input data. | CActiveRecord |
primaryKey() | Returns the primary key of the associated database table. | CActiveRecord |
raiseEvent() | Raises an event. | CComponent |
refresh() | Repopulates this active record with the latest data. | CActiveRecord |
refreshMetaData() | Refreshes the meta data for this AR class. | CActiveRecord |
relations() | PiiFile | |
rules() | PiiFile | |
save() | Saves the current record. | CActiveRecord |
saveAttributes() | Saves a selected list of attributes. | CActiveRecord |
scopes() | Returns the declaration of named scopes. | CActiveRecord |
setAttribute() | Sets the named attribute value. | CActiveRecord |
setAttributes() | Sets the attribute values in a massive way. | CModel |
setIsNewRecord() | CActiveRecord | |
setPrimaryKey() | Sets the primary key value. | CActiveRecord |
setScenario() | CModel | |
tableName() | PiiFile | |
update() | Updates the row represented by this active record. | CActiveRecord |
updateAll() | Updates records with the specified condition. | CActiveRecord |
updateByPk() | Updates records with the specified primary key(s). | CActiveRecord |
updateCounters() | Updates one or several counter columns. | CActiveRecord |
validate() | Performs the validation. | CModel |
with() | Specifies which related objects should be eagerly loaded. | CActiveRecord |
Protected Methods
Method | Description | Defined By |
---|---|---|
afterConstruct() | This method is invoked after a record instance is created by new operator. | CActiveRecord |
afterDelete() | This method is invoked after deleting a record. | CActiveRecord |
afterFind() | This method is invoked after each record is instantiated by a find method. | CActiveRecord |
afterSave() | This method is invoked after saving a record. | CActiveRecord |
afterValidate() | This method is invoked after validation ends. | CModel |
beforeDelete() | This method is invoked before deleting a record. | CActiveRecord |
beforeFind() | This method is invoked before an AR finder executes a find call. | CActiveRecord |
beforeSave() | This method is invoked before saving a record (after validation, if any). | CActiveRecord |
beforeValidate() | This method is invoked before validation starts. | CModel |
instantiate() | Creates an active record instance. | CActiveRecord |
Events
Event | Description | Defined By |
---|---|---|
onBeforeSave | This event is raised before the record is saved. | CActiveRecord |
onAfterSave | This event is raised after the record is saved. | CActiveRecord |
onBeforeDelete | This event is raised before the record is deleted. | CActiveRecord |
onAfterDelete | This event is raised after the record is deleted. | CActiveRecord |
onAfterConstruct | This event is raised after the record instance is created by new operator. | CActiveRecord |
onBeforeFind | This event is raised before an AR finder performs a find call. | CActiveRecord |
onAfterFind | This event is raised after the record is instantiated by a find method. | CActiveRecord |
onBeforeValidate | This event is raised before the validation is performed. | CModel |
onAfterValidate | This event is raised after the validation is performed. | CModel |
Property Details
fileList
property
read-only
public void getFileList($type=NULL, $order='name ASC')
Method Details
attributeLabels()
method
public array attributeLabels()
| ||
{return} | array | customized attribute labels (name=>label) |
behaviors()
method
public array behaviors()
| ||
{return} | array | model behaviours |
getFileList()
method
public void getFileList($type=NULL, $order='name ASC')
| ||
$type | ||
$order |
image()
method
public void image($id=NULL, $presetName='fckbrowse', $htmlOptions=array (
))
| ||
$id | ||
$presetName | ||
$htmlOptions |
model()
method
public static CActiveRecord model($className='PiiFile')
| ||
$className | ||
{return} | CActiveRecord | the static model class |
Returns the static model of the specified AR class.
relations()
method
public array relations()
| ||
{return} | array | relational rules. |
rules()
method
public array rules()
| ||
{return} | array | validation rules for model attributes. |
tableName()
method
public string tableName()
| ||
{return} | string | the associated database table name |