Exemple #1
0
 /**
  * @param Lib_Model $from
  */
 protected function settingsJoin($from)
 {
     foreach ($from->_settingsJoined as $name => $value) {
         // join external from externals perspective
         $this->settingJoin($name, $value);
     }
     $fromAlias = $from->getAlias();
     foreach ($from->getColumns() as $descriptor) {
         // join local from externals perspective
         $table = $descriptor[0];
         $column = $descriptor[1];
         $alias = $descriptor[2];
         if ($table === $fromAlias) {
             if ($alias) {
                 // has alias, just join
                 if ($from->settingExists($alias)) {
                     $this->settingJoin($alias, $from->getSetting($alias));
                 } elseif ($from->settingExists($column)) {
                     $this->settingJoin($alias, $from->getSetting($column));
                 }
             } elseif ($from->settingExists($column)) {
                 // needs to be aliased
                 $this->settingJoin("{$table}.{$column}", $from->getSetting($column));
             }
         }
     }
 }
Exemple #2
0
 /**
  * @static
  * @param bool $resetSettings
  * @return static
  */
 public static function find($resetSettings = false)
 {
     /** @var Lib_Model_Db $ret */
     $ret = parent::find($resetSettings);
     $ret->clearColumns();
     return $ret;
 }
Exemple #3
0
 public function init_from_id($id)
 {
     $this->id = $id;
     parent::init_from_id($id);
 }
Exemple #4
0
 function update()
 {
     $this->last_t = RUNTIME;
     $this->set('last_t');
     parent::update();
 }