PHP Interface Nextras\Orm\Entity\IEntity

Inheritance: extends Serializabl\Serializable
Exibir arquivo Open project: nextras/orm Interface Usage Examples

Public Methods

Method Description
fireEvent ( string $method, array $args = [] ) Fires event.
getMetadata ( ) : EntityMetadata Returns entity metadata.
getModel ( boolean $need = true ) : Nextras\Orm\Model\IModel Returns entity model.
getPersistedId ( ) : mixed Returns persisted primary value.
getPreloadContainer ( ) : Nextras\Orm\Collection\IEntityPreloadContainer
getProperty ( string $name ) : mixed | Nextras\Orm\Entity\IPropertyContainer Returns property contents.
getRawProperty ( string $name ) : mixed Returns property raw contents.
getRawValue ( string $name ) : mixed Returns raw value.
getRepository ( boolean $need = true ) : Nextras\Orm\Repository\IRepository | null Returns entity repository.
getValue ( string $name ) : mixed Returns value.
hasValue ( string $name ) : boolean Returns true if property has a value (not null).
isAttached ( ) : boolean Returns true if entity is attached to its repository.
isModified ( string $name = null ) : boolean Returns true if the entity is modiefied or the column $name is modified.
isPersisted ( ) : boolean Returns true if entity is persisted.
setAsModified ( string $name = null ) : self Sets the entity or the column as modified.
setPreloadContainer ( Nextras\Orm\Collection\IEntityPreloadContainer $overIterator = null ) Sets the collection of entites for the loading relations at once.
setRawValue ( string $name, mixed $value ) Sets raw value.
setReadOnlyValue ( string $name, mixed $value ) : self Sets read-only value.
setValue ( string $name, mixed $value ) : self Sets property value.
toArray ( integer $mode = self::TO_ARRAY_RELATIONSHIP_AS_IS ) : array Converts entity to array.

Method Details

fireEvent() public method

Fires event.
public fireEvent ( string $method, array $args = [] )
$method string
$args array

getMetadata() public method

Returns entity metadata.
public getMetadata ( ) : EntityMetadata
return Nextras\Orm\Entity\Reflection\EntityMetadata

getModel() public method

Returns entity model.
public getModel ( boolean $need = true ) : Nextras\Orm\Model\IModel
$need boolean
return Nextras\Orm\Model\IModel

getPersistedId() public method

Returns persisted primary value.
public getPersistedId ( ) : mixed
return mixed

getPreloadContainer() public method

public getPreloadContainer ( ) : Nextras\Orm\Collection\IEntityPreloadContainer
return Nextras\Orm\Collection\IEntityPreloadContainer

getProperty() public method

Returns property contents.
public getProperty ( string $name ) : mixed | Nextras\Orm\Entity\IPropertyContainer
$name string
return mixed | Nextras\Orm\Entity\IPropertyContainer

getRawProperty() public method

Returns property raw contents.
public getRawProperty ( string $name ) : mixed
$name string
return mixed

getRawValue() public method

Raw value is normalized value which is suitable unique identification and storing.
public getRawValue ( string $name ) : mixed
$name string
return mixed

getRepository() public method

Returns entity repository.
public getRepository ( boolean $need = true ) : Nextras\Orm\Repository\IRepository | null
$need boolean
return Nextras\Orm\Repository\IRepository | null

getValue() public method

Returns value.
public getValue ( string $name ) : mixed
$name string
return mixed

hasValue() public method

Returns true if property has a value (not null).
public hasValue ( string $name ) : boolean
$name string
return boolean

isAttached() public method

Returns true if entity is attached to its repository.
public isAttached ( ) : boolean
return boolean

isModified() public method

Returns true if the entity is modiefied or the column $name is modified.
public isModified ( string $name = null ) : boolean
$name string
return boolean

isPersisted() public method

Returns true if entity is persisted.
public isPersisted ( ) : boolean
return boolean

setAsModified() public method

Sets the entity or the column as modified.
public setAsModified ( string $name = null ) : self
$name string
return self

setPreloadContainer() public method

Sets the collection of entites for the loading relations at once.
public setPreloadContainer ( Nextras\Orm\Collection\IEntityPreloadContainer $overIterator = null )
$overIterator Nextras\Orm\Collection\IEntityPreloadContainer

setRawValue() public method

Sets raw value.
public setRawValue ( string $name, mixed $value )
$name string
$value mixed

setReadOnlyValue() public method

Sets read-only value.
public setReadOnlyValue ( string $name, mixed $value ) : self
$name string
$value mixed
return self

setValue() public method

Sets property value.
public setValue ( string $name, mixed $value ) : self
$name string
$value mixed
return self

toArray() public method

Converts entity to array.
public toArray ( integer $mode = self::TO_ARRAY_RELATIONSHIP_AS_IS ) : array
$mode integer
return array