Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class arbitModelBase

Core::Model::arbitModelBase

Class arbitModelBase

Basic model class, provifing the default methods for getters and setters for model classes.

Basic model class, provifing the default methods for getters and setters for model classes.

arbitBaseStruct
   |
   --arbitModelBase
Author(s):
Version:   $Revision: 1236 $
License:   GPL

Descendants

Child Class Description
arbitModuleModelFaqQuestion Project model
arbitModuleModelFaqCategories Categories model
arbitModuleModelNotification Project model
arbitModuleModelSourceAnnotation Project model
arbitModuleModelWikiPage Project model
arbitModuleModelTrackerComment Project model
arbitModuleModelTrackerIssue Project model
arbitModuleModelTrackerIssueStatistics Issue statistics model;
arbitModelProject Project model
arbitModelUser User model
arbitModelGroup Group model

Member Variables

protected string $defaultFetchMethod = null
Method from the model class implementation used to fetch the requested data value for the constructed model. the data is actually requested from the model.

Method from the model class implementation used to fetch the requested data value for the constructed model. The method is called lazy, when the data is actually requested from the model. The here given method is used, when there is nor special callback defined in the $specialFetchMethods array.

protected mixed $id = null
Model id This may be any arbrtrary identifier generated by the backend or the database itself. map directly to an of the properties.

Model id This may be any arbrtrary identifier generated by the backend or the database itself. Store for later reference, as the ID does not need to map directly to an of the properties.

protected array $modifiedProperty = array()
Array with a list of modified properties, which means properties, where the data has been changed from the application, which should be stored in the backend.

Array with a list of modified properties, which means properties, where the data has been changed from the application, which should be stored in the backend.

protected array $properties = array()
Array containing all model properties, all with the value "null", as they have to be unintialized at this stage.

Array containing all model properties, all with the value "null", as they have to be unintialized at this stage. The array should look like:

  1.   array(
  2.       'property' => null
  3.       ...
  4.   )

protected array $specialFetchMethods = array(
)

Method from the model class implementation used to fetch the requested data value for the constructed model. the data is actually requested from the model. like:

Method from the model class implementation used to fetch the requested data value for the constructed model. The method is called lazy, when the data is actually requested from the model. The array should look like:

  1.   array(
  2.       'property' => 'callbackMethodName',
  3.       ...
  4.   )

protected bool $static = false
Set to true, to force that no new data should be fetched. represents an older revision of the model.

Set to true, to force that no new data should be fetched. This may be required if the model actually represents an older revision of the model.

protected array $userModelProperties = array(
'author',
)

Properties containing user IDs Properties containing user IDs, which should be transformed into user models. current model, all properties with this name are also transformed.

Properties containing user IDs Properties containing user IDs, which should be transformed into user models. If the revision property is set with older revisions of the current model, all properties with this name are also transformed.

Method Summary

public void __construct( [ $id = null] )
Create model from identifier If the identifier of the model is known from somewhere in the application you may set it directly here instead of searching for some value.
public abstract void create( )
Method called to create a new instance in the backend.
protected array getModifiedValues( )
Return modified values Return an array with all values which has been modified on the current model instance, with their new values.
public abstract void storeChanges( )
Method called to store changes to the model.
protected mixed toUserModel( $property )
Transform value to user model(s) Transform a user ID or an array with user IDs in the a user mdoel, or an array of user models.
protected array transformUserProperties( $data )
Transform all user properties Transform all iser IDs in the declared user properties into user models.

Inherited Methods

From arbitBaseStruct
protected void arbitBaseStruct::deepClone()
Deep clone array structures
public array arbitBaseStruct::getProperties()
Get property names Returns an arary with all properties defined in this struct.
public void arbitBaseStruct::__clone()
Method called, when struct ist cloned

Methods

__construct

void __construct( [mixed $id = null] )

Create model from identifier If the identifier of the model is known from somewhere in the application you may set it directly here instead of searching for some value.

Create model from identifier If the identifier of the model is known from somewhere in the application you may set it directly here instead of searching for some value.

Parameters:
Name Type Description
$id mixed
Redefined in descendants as:
Method Description
arbitModuleModelFaqCategories::__construct() Create categories model 
arbitModuleModelNotification::__construct() Create project model 
arbitModelProject::__construct() Create project model 

create

void create( )

Method called to create a new instance in the backend.

Method called to create a new instance in the backend. Method called when the model should be created in the backend the first time. This will normally throw an error if a model with the same identifier already exists in the backend.

Redefined in descendants as:
Method Description
arbitModuleModelFaqQuestion::create() Method called to create a new instance in the backend. 
arbitModuleModelFaqCategories::create() Method called to create a new instance in the backend. 
arbitModuleModelNotification::create() Method called to create a new instance in the backend. 
arbitModuleModelSourceAnnotation::create() Method called to create a new instance in the backend. 
arbitModuleModelWikiPage::create() Method called to create a new instance in the backend. 
arbitModuleModelTrackerComment::create() Method called to create a new instance in the backend. 
arbitModuleModelImporterComment::create() Method called to create a new instance in the backend. 
arbitModuleModelTrackerIssue::create() Method called to create a new instance in the backend. 
arbitModuleModelImporterIssue::create() Method called to create a new instance in the backend. 
arbitModuleModelTrackerIssueStatistics::create() Method called to create a new instance in the backend. 
arbitModelProject::create() Method called to create a new instance in the backend. 
arbitModelUser::create() Method called to create a new instance in the backend. 
arbitModelGroup::create() Method called to create a new instance in the backend. 

getModifiedValues

array getModifiedValues( )

Return modified values Return an array with all values which has been modified on the current model instance, with their new values.

Return modified values Return an array with all values which has been modified on the current model instance, with their new values.

storeChanges

void storeChanges( )

Method called to store changes to the model.

Method called to store changes to the model. Method called to store changes in the model to the backend. The method should only modify the backend data, if something really has been changed in the model. Use the __set() method, which should wrap all write access to the model, to remember write access.

Redefined in descendants as:
Method Description
arbitModuleModelFaqQuestion::storeChanges() Method called to store changes to the model. 
arbitModuleModelFaqCategories::storeChanges() Method called to store changes to the model. 
arbitModuleModelNotification::storeChanges() Method called to store changes to the model. 
arbitModuleModelSourceAnnotation::storeChanges() Method called to store changes to the model. 
arbitModuleModelWikiPage::storeChanges() Method called to store changes to the model. 
arbitModuleModelTrackerComment::storeChanges() Method called to store changes to the model. 
arbitModuleModelImporterComment::storeChanges() Method called to store changes to the model. 
arbitModuleModelTrackerIssue::storeChanges() Method called to store changes to the model. 
arbitModuleModelImporterIssue::storeChanges() Method called to store changes to the model. 
arbitModuleModelTrackerIssueStatistics::storeChanges() Method called to store changes to the model. 
arbitModelProject::storeChanges() Method called to store changes to the model. 
arbitModelUser::storeChanges() Method called to store changes to the model. 
arbitModelGroup::storeChanges() Method called to store changes to the model. 

toUserModel

mixed toUserModel( mixed $property )

Transform value to user model(s) Transform a user ID or an array with user IDs in the a user mdoel, or an array of user models.

Transform value to user model(s) Transform a user ID or an array with user IDs in the a user mdoel, or an array of user models.

Parameters:
Name Type Description
$property mixed

transformUserProperties

array transformUserProperties( $data )

Transform all user properties Transform all iser IDs in the declared user properties into user models.

Transform all user properties Transform all iser IDs in the declared user properties into user models. If the model has a revisions property, the transformation will also be performed for all revisions of the model.

Parameters:
Name Type Description
$data array
Documentation generated on Mon, 05 Apr 2010 14:01:38 +0200 by phpDocumentor 1.4.3