/** * Primary alias points to table related to parent record. * * @return string */ public function primaryAlias() { return $this->loader->getAlias(); }
/** * SQL identified to parent record outer key (usually primary key). * * @return string * @throws LoaderException */ protected function getParentKey() { if (empty($this->parent)) { throw new LoaderException("Unable to get parent key, no parent loader provided."); } return $this->parent->getAlias() . '.' . $this->definition[RecordEntity::INNER_KEY]; }
/** * Create delete statement based on WHERE statement provided by Selector. * * @param QueryCompiler $compiler * @return string */ protected function deleteStatement(QueryCompiler $compiler = null) { $compiler = !empty($compiler) ? $compiler : $this->compiler->reset(); $this->loader->configureSelector($this, false); return $compiler->delete($this->loader->getTable() . ' AS ' . $this->loader->getAlias(), $this->whereTokens); }