PHP Class Blast\Orm\Relations\ManyToMany

Inheritance: implements Blast\Orm\ConnectionAwareInterface, implements Blast\Orm\Entity\ProviderFactoryInterface, implements Blast\Orm\Relations\RelationInterface, use trait Blast\Orm\ConnectionAwareTrait, use trait Blast\Orm\Entity\EntityAwareTrait, use trait Blast\Orm\Entity\ProviderFactoryTrait, use trait RelationTrait
Show file Open project: phpthinktank/blast-orm

Public Methods

Method Description
__construct ( string | object $entity, string | object $foreignEntity, null | string $foreignKey = null, null | string $localKey = null, null | string | object $junction = null, null | string $junctionLocalKey = null, null | string $junctionForeignKey = null ) Many occurrences in local entity relate to many occurrences in foreign entity and vice versa.
execute ( ) : SplStack
getForeignEntity ( ) : object | string
getForeignKey ( ) : null | string
getJunction ( ) : null | object | string
getJunctionForeignKey ( ) : null | string
getJunctionLocalKey ( ) : null | string
getLocalKey ( ) : null | string
getQuery ( ) : Query Get relation query

Method Details

__construct() public method

The relations are linked by a junction table.
public __construct ( string | object $entity, string | object $foreignEntity, null | string $foreignKey = null, null | string $localKey = null, null | string | object $junction = null, null | string $junctionLocalKey = null, null | string $junctionForeignKey = null )
$entity string | object
$foreignEntity string | object
$foreignKey null | string Default field name is {foreign primary key name}
$localKey null | string Default field name is {local primary key name}
$junction null | string | object Default table name is {local entity table name}_{foreign entity table name}
$junctionLocalKey null | string Default field name is {local table name}_{$localKey}
$junctionForeignKey null | string Default field name is {foreign table name}_{$foreignKey}

execute() public method

public execute ( ) : SplStack
return SplStack

getForeignEntity() public method

public getForeignEntity ( ) : object | string
return object | string

getForeignKey() public method

public getForeignKey ( ) : null | string
return null | string

getJunction() public method

public getJunction ( ) : null | object | string
return null | object | string

getJunctionForeignKey() public method

public getJunctionForeignKey ( ) : null | string
return null | string

getJunctionLocalKey() public method

public getJunctionLocalKey ( ) : null | string
return null | string

getLocalKey() public method

public getLocalKey ( ) : null | string
return null | string

getQuery() public method

Get relation query
public getQuery ( ) : Query
return Blast\Orm\Query