/** * Set the keys for a save update query. * * @param \Analogue\ORM\Query $query * @return \Analogue\ORM\Query */ protected function setKeysForSaveQuery(Query $query) { $query->where($this->morphType, $this->morphClass); return parent::setKeysForSaveQuery($query); }
/** * Create a new pivot model instance. * * @param array $attributes * @param bool $exists * @return \Analogue\ORM\Relationships\Pivot */ public function newPivot(array $attributes = array(), $exists = false) { $pivot = new Pivot($this->parent, $this->parentMap, $attributes, $this->table, $exists); return $pivot->setPivotKeys($this->foreignKey, $this->otherKey); }