protected function getModel($id = null) { $model = null; if ($id) { $model = File::findOne(["id" => $id]); } else { $model = new File(); } return $model; }
/** * 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]); }