public function quote($string) { if ($this->_left instanceof modelField) { $collection = $this->_left->getCollection(); return $collection->getStorage()->quote($string); } throw new Exception('left is ' . get_class($this->_left)); }
public function getCollection() { return $this->_argument->getCollection(); }
/** * * @param modelField $field */ protected function _fixJoinField(&$field) { $collection = modelCollection::getInstanceById($field->getCollectionId()); $foreignKeys = $collection->getForeignKeys(); $fieldName = $field->getName(); if (isset($foreignKeys[$fieldName])) { foreach ($foreignKeys[$fieldName] as $foreignModel => $foreignKey) { foreach ($this->_joinedTables as $table) { /** modelCollection $table */ if ($foreignModel == $table->getModelClass()) { $field = $table->{$foreignKey}; return; } } } } }