private function allocateArticleParameters($article) { if (!empty($_POST['title'])) { $article->title = $_POST['title']; } if (!empty($_POST['date'])) { $article->date = date('Y-m-d', strtotime($_POST['date'])); } if (!empty($_FILES)) { $res = File::File_upload('news'); if (false !== $res) { $article->path = file_get_contents($res); } } return $article; }