protected function prepare_conditions(&$options)
 {
     parent::prepare_conditions($options);
     if (!empty($options['conditions'])) {
         $options['conditions'] .= ' AND ';
     } else {
         $options['conditions'] = '';
     }
     $options['conditions'] .= $this->quoted_join_table() . '.' . $this->quoted_foreign_key() . ' = ' . $this->owner->get_quoted_id();
 }
Ejemplo n.º 2
0
 protected function prepare_conditions(&$options)
 {
     parent::prepare_conditions($options);
     if (!empty($options['conditions'])) {
         $options['conditions'] .= ' AND ';
     } else {
         $options['conditions'] = '';
     }
     $options['conditions'] .= $this->quoted_table_name() . '.' . $this->quoted_foreign_key() . ' = ' . $this->owner->get_quoted_id();
     if ($this->is_polymorphic()) {
         $options['conditions'] .= ' AND ' . $this->quoted_table_name() . '.' . $this->quoted_foreign_type() . ' = ' . ActiveRecord::$connection->quote_string(get_class($this->owner));
     }
 }