메소드 |
설명 |
|
__callStatic ( $method, $params ) |
Delegates find calls through to the finder |
|
__construct ( ) |
The final constructer which initializes the object. Subclasses
can implement {@link construct()} instead |
|
__get ( $key ) |
Magic method, delegates to the schema for getters |
|
__isset ( $key ) |
Magic method, delegates to the schema |
|
__set ( $key, $value ) |
Magic method, delegates to the schema for setters |
|
__toString ( ) |
String coercion. Returns a value like "ClassName[pkcol1=foo,pkcol2=bar]" |
|
changes ( ) : array |
Returns a key=>val array of properties that have changed since the last save |
|
className ( ) |
Return the class name of the domain object |
|
clearChanges ( ) |
Clears the changes array |
|
connection ( ) : Connection |
Returns the connection object for the domain object. |
|
create ( ) : DomainObject |
Creates and saves a domain object, var args are passed to the constructor |
|
delete ( ) |
Deletes the domain object via the associated mapper |
|
diff ( $object ) |
Returns keys that differ between the two objects |
|
equals ( $object ) |
Compares the properties of one domain object to that of another |
|
eventHandler ( $e, $obj ) : void |
Handles events for the domain object, looks for local methods named after
the event, e.g beforeSave. The event is passed as a parameter |
|
events ( $events = [] ) : Events |
Returns the domain objects event collection, optionally registering any passed
events |
|
fromArray ( $array = [] ) |
Creates an instance from an array, bypassing the constructor and setters |
|
get ( $prop ) : mixed |
Gets a property |
|
has ( $prop ) |
Whether the object has a property, even if it's null |
|
identity ( ) : Identity |
Returns an Identity object for the domain object |
|
import ( $records ) : array |
Creates and saves a array or arrays as domain objects |
|
initialize ( $builder, $pheasant ) |
Template function for configuring a domain object. Looks for either
a tableName() method or a mapper() method, a properties() method and a
relationships() method. |
|
isSaved ( ) : boolean |
Returns whether the object has been saved |
|
load ( $array, $filter = false ) |
Loads an array of values into the object |
|
lock ( $onChanged = null ) |
Creates a concurrency lock on the domain object, with an optional
closure to execute if the object has changed in the db when the lock
finally provided. Closure gets the original and the new object |
|
markSaved ( $value = true ) |
Change the objects saved state |
|
offsetExists ( $offset ) |
array object |
|
offsetGet ( $offset ) |
|
|
offsetSet ( $offset, $value ) |
|
|
offsetUnset ( $offset ) |
|
|
override ( $property, $closure ) |
Defines a closure that is called when the property is accessed. |
|
reload ( ) |
Reloads the contents of the object |
|
save ( ) |
Saves the domain object via the associated mapper |
|
saveAfter ( $object ) |
Register a domain object to be saved after the current domain object is saved |
|
schema ( ) : Schema |
Returns the Schema registered for this class. |
|
scopes ( ) |
Returns an array of scope functions |
|
set ( $prop, $value ) |
Sets a property |
|
toArray ( ) : array |
Returns the object as an array |
|
transaction ( $closure, $execute = true ) : Transaction |
Creates a transaction, passes the instance |
|