PHP 클래스 Scalr\Model\AbstractEntity

부터: 4.5.0 (10.10.2013)
저자: Vitaliy Demidov ([email protected])
상속: extends Scalr\Model\AbstractGetter, implements IteratorAggregat\IteratorAggregate
파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

공개 메소드들

메소드 설명
__call ( $method, $args )
__callStatic ( $name, $arguments )
__get ( $prop )
__set ( $prop, $value )
__unset ( $prop )
_buildQuery ( array $criteria, string $conjunction = 'AND', string $tableAlias = null ) : array Builds query statement
db ( ) : ADODB_mysqli Gets database instance associated with the entity
delete ( ) Removes current record from database by primary key
fields ( string $tableAlias = null, boolean $prefixed = false ) : string Gets comma separated list of the columns prefixed either with the table name or the specified table alias
getEntityAnnotation ( ) : Scalr\Model\Loader\Entity Gets entity annotation for the class
getIterator ( ) : Scalr\Model\EntityPropertiesIterator
load ( array | object $obj, string $tableAlias = null ) Loads an entity from array or object
qstr ( string | Scalr\Model\Loader\Field $field, mixed $value = null ) : string Escapes value for the field
result ( integer $resultType ) : AbstractEntity Instantiate an object and sets the type of the result
save ( ) Saves current entity to database
table ( string $alias = null ) : string Gets table name which is associated with the entity
type ( string $field ) : Scalr\Model\Type\TypeInterface Gets the type for the specified field
update ( array | Iterato\Iterator $fieldValues ) Updates only specified properties to database ingoring all others

비공개 메소드들

메소드 설명
_column ( string $fieldName, string $tableAlias = null, string $alias = null ) : string Gets column name for the specified field
_delete ( array $criteria = null, integer $limit = null ) : integer Removes records from database by criteria
_deletePk ( array $args = [] ) : integer Removes record from database by primary key
_fetchIndexes ( ) Retrieves show indexes info and stores it in the cache
_find ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : ArrayCollection | EntityIterator | ADORecordSet_mysql\ADORecordSet_mysqli Finds collection of the values by any key
_findOne ( array $criteria = null, array $group = null, array $order = null ) : AbstractEntity | null Finds one record by given criteria
_findPk ( array $args = [] ) : AbstractEntity | null Finds record by primary key
_hasUniqueIndex ( ) : boolean Checks whether the table has at least one unique index
_parseClassDocComment ( ) Parses phpdoc comment for entity class
_prepareSaveStatement ( ) : Scalr\Model\EntityStatement Prepares statement to store data in database

메소드 상세

__call() 공개 메소드

public __call ( $method, $args )

__callStatic() 공개 정적인 메소드

public static __callStatic ( $name, $arguments )

__get() 공개 메소드

public __get ( $prop )

__set() 공개 메소드

public __set ( $prop, $value )

__unset() 공개 메소드

public __unset ( $prop )

_buildQuery() 공개 메소드

Builds query statement
public _buildQuery ( array $criteria, string $conjunction = 'AND', string $tableAlias = null ) : array
$criteria array Criteria array
$conjunction string optional Conjucntion
$tableAlias string optional Table alias
리턴 array

db() 공개 메소드

Gets database instance associated with the entity
public db ( ) : ADODB_mysqli
리턴 ADODB_mysqli Database connection instance

delete() 공개 메소드

Removes current record from database by primary key
public delete ( )

fields() 공개 메소드

Gets comma separated list of the columns prefixed either with the table name or the specified table alias
public fields ( string $tableAlias = null, boolean $prefixed = false ) : string
$tableAlias string optional An table alias
$prefixed boolean optional Should the column names be provided with alias prefixed by the tableAlias
리턴 string Returns comma separated list of the columns

getEntityAnnotation() 공개 메소드

Gets entity annotation for the class
public getEntityAnnotation ( ) : Scalr\Model\Loader\Entity
리턴 Scalr\Model\Loader\Entity Returns entity annotation for the class

getIterator() 공개 메소드

또한 보기: IteratorAggregate::getIterator()
public getIterator ( ) : Scalr\Model\EntityPropertiesIterator
리턴 Scalr\Model\EntityPropertiesIterator Gets EntityPropertiesIterator

load() 공개 메소드

Loads an entity from array or object
public load ( array | object $obj, string $tableAlias = null )
$obj array | object Source data
$tableAlias string optional The table alias which should be threated as column name prefix

qstr() 공개 메소드

Escapes value for the field
public qstr ( string | Scalr\Model\Loader\Field $field, mixed $value = null ) : string
$field string | Scalr\Model\Loader\Field The name of the field or the Field object
$value mixed optional The value to escape or it will take field's value from the object
리턴 string Returns escaped value for the fiel

result() 공개 정적인 메소드

Instantiate an object and sets the type of the result
public static result ( integer $resultType ) : AbstractEntity
$resultType integer The type of the result
리턴 AbstractEntity

save() 공개 메소드

Saves current entity to database
public save ( )

table() 공개 메소드

Gets table name which is associated with the entity
public table ( string $alias = null ) : string
$alias string optional The table alias
리턴 string The name of the database table

type() 공개 메소드

Alias of the $entity->getIterator()->getField('name')->type;
public type ( string $field ) : Scalr\Model\Type\TypeInterface
$field string The name of the field
리턴 Scalr\Model\Type\TypeInterface Returns field's type

update() 공개 메소드

It also stores field's values in the object itself.
public update ( array | Iterato\Iterator $fieldValues )
$fieldValues array | Iterato\Iterator The list of the fields with its values looks like [fieldName1 => $value1, filedName2 ...] If it is provided with the field name in the value place with numerical index it will update the record with the value taken from the entity itself.