/** * @param File $_file */ public function setImageFile(File $_file) { if (!$_file->isImage()) { throw new InvalidArgumentException("File must be of type 'Image'."); } $this->_image_file = $_file; $query = "UPDATE `user` SET image_file_id = :fi WHERE id = :id"; $args = ["fi" => $this->image_file_id = $_file->getId(), "id" => $this->id]; $this->_pdo->perform($query, $args); }
public function setSyllabus(File $syllabus_id) { $this->_syllabus = $syllabus_id; $this->syllabus_id = $syllabus_id->getId(); $this->_pdo->perform("UPDATE pledge_class SET syllabus_id = :s WHERE id = :id", ["s" => $syllabus_id->getId(), "id" => $this->id]); }