Blast\Orm\Relations\ManyToMany::__construct PHP Method

__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}
    public function __construct($entity, $foreignEntity, $foreignKey = null, $localKey = null, $junction = null, $junctionLocalKey = null, $junctionForeignKey = null)
    {
        $this->entity = $entity;
        $this->foreignEntity = $foreignEntity;
        $this->foreignKey = $foreignKey;
        $this->localKey = $localKey;
        $this->junction = $junction;
        $this->junctionLocalKey = $junctionLocalKey;
        $this->junctionForeignKey = $junctionForeignKey;
    }