Example #1
0
 protected function getModel($id = null)
 {
     $model = null;
     if ($id) {
         $model = File::findOne(["id" => $id]);
     } else {
         $model = new File();
     }
     return $model;
 }
Example #2
0
 /**
  * Get system file
  * 
  * @param string $systemKey Unique system key
  * 
  * @return ActiveQueryInterface the newly created [[ActiveQueryInterface|ActiveQuery]] instance. 
  */
 public static function getSystemFile($systemKey)
 {
     return File::findOne(['system_key' => $systemKey]);
 }