/** * Create a new has many relationship instance. * * @param \Sgpatil\Orientdb\Eloquent\Builder $query * @param \Sgpatil\Orientdb\Eloquent\Model $parent * @param string $type * @return void */ public function __construct(Builder $query, Model $parent, $foreignKey, $localKey) { $this->localKey = $localKey; $this->foreignKey = $foreignKey; $this->query = $query; $this->parent = $parent; $this->related = $query->getModel(); parent::__construct($query, $parent, $foreignKey->getTable(), $localKey); }
/** * Get the current connection name. * * @return string */ public function getConnectionName() { return $this->query->getModel()->getConnectionName(); }