PHP 클래스 Blast\Orm\Mapper

상속: implements Blast\Orm\Entity\EntityAwareInterface, implements Blast\Orm\ConnectionAwareInterface, implements Blast\Orm\MapperInterface, implements Blast\Orm\Entity\ProviderFactoryInterface, use trait ConnectionAwareTrait, use trait Blast\Orm\Entity\EntityAwareTrait, use trait Blast\Orm\Entity\ProviderFactoryTrait
파일 보기 프로젝트 열기: phpthinktank/blast-orm

공개 메소드들

메소드 설명
__construct ( array | ArrayObject | stdClas\stdClass | object | string $entity, Doctrine\DBAL\Driver\Connection $connection = null ) Disable direct access to mapper
belongsTo ( $entity, $foreignEntity, null $localKey = null ) : Query BelongsTo is the inverse of a HasOne or a HasMany relation.
create ( array | ArrayObject | stdClass | object $entity ) : Query | boolean Create query for new entity.
createGateway ( $tableName ) : Gateway Create a new Query instance
createQuery ( ) : Query Create a new Query instance
delete ( integer | string $identifier ) : query Prepare delete query for attached entity by identifiers
find ( mixed $primaryKey ) : Query Select query for finding entity by primary key
getDefinition ( ) : Blast\Orm\Entity\DefinitionInterface
getProvider ( ) : Blast\Orm\Entity\ProviderInterface
hasMany ( $entity, $foreignEntity, null $foreignKey = null ) : Query One entity is associated with many related entities by a field which associates with primary key in current entity.
hasOne ( $entity, $foreignEntity, null | string $foreignKey = null ) : Query One entity is associated with one related entity by a field which associates with primary key in current entity.
manyToMany ( $entity, $foreignEntity, null $foreignKey = null, null $localKey = null, null $junction = null, null $junctionLocalKey = null, null $junctionForeignKey = null ) : Query Many entities of type _A_ are associated with many related entities of type _B_ by a junction table.
save ( ArrayObject | SplStack | stdClass | object $entity ) : Query Create or update an entity
select ( array $selects = ['*'] ) : Query Select query for entity
update ( array | ArrayObject | stdClass | object $entity ) : Query Update query for existing Model or a collection of entities in storage

비공개 메소드들

메소드 설명
checkEntity ( $entity ) Check if external entity matches mapper entity
prepareProvider ( $entity ) : Provider Prepare provider by determining entity type
prepareRelation ( Blast\Orm\Relations\RelationInterface $relation ) : mixed Share mapper connection with relation

메소드 상세

__construct() 공개 메소드

Disable direct access to mapper
public __construct ( array | ArrayObject | stdClas\stdClass | object | string $entity, Doctrine\DBAL\Driver\Connection $connection = null )
$entity array | ArrayObject | stdClas\stdClass | object | string
$connection Doctrine\DBAL\Driver\Connection

belongsTo() 공개 메소드

One entity is associated with one related entity by a field which associates with primary key in related entity.
public belongsTo ( $entity, $foreignEntity, null $localKey = null ) : Query
$entity
$foreignEntity
$localKey null
리턴 Query

create() 공개 메소드

Create query for new entity.
public create ( array | ArrayObject | stdClass | object $entity ) : Query | boolean
$entity array | ArrayObject | stdClass | object
리턴 Query | boolean

createGateway() 공개 메소드

Create a new Query instance
public createGateway ( $tableName ) : Gateway
리턴 Gateway

createQuery() 공개 메소드

Create a new Query instance
public createQuery ( ) : Query
리턴 Query

delete() 공개 메소드

Prepare delete query for attached entity by identifiers
public delete ( integer | string $identifier ) : query
$identifier integer | string
리턴 query

find() 공개 메소드

Select query for finding entity by primary key
public find ( mixed $primaryKey ) : Query
$primaryKey mixed
리턴 Query

getDefinition() 공개 메소드

public getDefinition ( ) : Blast\Orm\Entity\DefinitionInterface
리턴 Blast\Orm\Entity\DefinitionInterface

getProvider() 공개 메소드

public getProvider ( ) : Blast\Orm\Entity\ProviderInterface
리턴 Blast\Orm\Entity\ProviderInterface

hasMany() 공개 메소드

One entity is associated with many related entities by a field which associates with primary key in current entity.
public hasMany ( $entity, $foreignEntity, null $foreignKey = null ) : Query
$entity
$foreignEntity
$foreignKey null
리턴 Query

hasOne() 공개 메소드

One entity is associated with one related entity by a field which associates with primary key in current entity.
public hasOne ( $entity, $foreignEntity, null | string $foreignKey = null ) : Query
$entity
$foreignEntity
$foreignKey null | string
리턴 Query

manyToMany() 공개 메소드

The junction table stores associations from entities of type _A_ to entities of type _B_.
public manyToMany ( $entity, $foreignEntity, null $foreignKey = null, null $localKey = null, null $junction = null, null $junctionLocalKey = null, null $junctionForeignKey = null ) : Query
$entity
$foreignEntity
$foreignKey null
$localKey null
$junction null
$junctionLocalKey null
$junctionForeignKey null
리턴 Query

save() 공개 메소드

Create or update an entity
public save ( ArrayObject | SplStack | stdClass | object $entity ) : Query
$entity ArrayObject | SplStack | stdClass | object
리턴 Query

select() 공개 메소드

Select query for entity
public select ( array $selects = ['*'] ) : Query
$selects array
리턴 Query

update() 공개 메소드

Update query for existing Model or a collection of entities in storage
public update ( array | ArrayObject | stdClass | object $entity ) : Query
$entity array | ArrayObject | stdClass | object
리턴 Query