Ejemplo n.º 1
0
 function debug($level = self::DEBUG_ON)
 {
     parent::debug($level);
 }
Ejemplo n.º 2
0
 function debug($level = self::DEBUG_ON)
 {
     parent::debug($level);
     if ($this->debugLevel && !$this->logger) {
         $this->logger = new SqlLogger(true);
     }
 }
Ejemplo n.º 3
0
 function getOneId($type, $primaryKey = null)
 {
     if (!$primaryKey) {
         $primaryKey = $this->db[$type]->getPrimaryKey();
     }
     $id = $type . '_' . $primaryKey;
     if ($this->{$id}) {
         return $this->{$id};
     }
     if (isset($this->{'_one_' . $type}) && ($o = $this->{'_one_' . $type}) || isset($this->{'_one_' . $type . '_x_'}) && ($o = $this->{'_one_' . $type . '_x_'})) {
         if (is_scalar($o) || is_null($o)) {
             if (DataSource::canBeTreatedAsInt($o)) {
                 return $o;
             } else {
                 return $this->db[$type][$o]->{$primaryKey};
             }
         } elseif (is_object($o)) {
             return $o->{$primaryKey};
         } elseif (is_array($o)) {
             return $o[$primaryKey];
         }
     }
 }