public function createPivots($relatedEntities)
    {
        $keys = [];
        $attributes = [];

        $keyName = $this->relatedMap->getKeyName();

        foreach ($relatedEntities as $entity) {
            $keys[] = $entity->getEntityAttribute($keyName);
        }

        $records = $this->createAttachRecords($keys, $attributes);

        $this->query->getQuery()->from($this->table)->insert($records);
    }
public function createPivots($relatedEntities)
    {
        $keys = [];
        $attributes = [];

        $keyName = $this->relatedMap->getKeyName();

        foreach ($relatedEntities as $entity) {
            $keys[] = $entity->getEntityAttribute($keyName);
        }

        $records = $this->createAttachRecords($keys, $attributes);

        $this->query->getQuery()->from($this->table)->insert($records);
    }
public function createPivots ( $ relatedEntities ) { $ keys = [ ] ; $ attributes = [ ] ; $ keyName = $ this -> relatedMap -> getKeyName ( ) ; foreach ( $ relatedEntities as $ entity ) { $ keys [ ] = $ entity -> getEntityAttribute ( $ keyName ) ; } $ records = $ this -> createAttachRecords ( $ keys , $ attributes ) ; $ this -> query -> getQuery ( ) -> from ( $ this -> table ) -> insert ( $ records ) ; }
Create Pivot Records.

@param \Analogue\ORM\Entity[] $relatedEntities

@return void
Create Pivot Records .