Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ITS\base;
- use \Psr\Http\Message\ServerRequestInterface as Request;
- use \Psr\Http\Message\ResponseInterface as Response;
- use Slim\Http\UploadedFile;
- class pictures {
- private $pdo;
- private $directory = "/uploads/pictures/assets/vehicles";
- private $picture = null;
- private $tableId;
- public function __construct($pdo, $tableId){
- $this->pdo = $pdo;
- $this->tableId = $tableId;
- }
- public function preparePic(UploadedFile $uploadedFile){
- // handle single input with single file upload
- if ($uploadedFile->getError() === UPLOAD_ERR_OK) {
- $this->picture = $uploadedFile;
- $this->filename = "ITS-".time();
- return $this->filename;
- }
- }
- public function removePic(){}
- public function commitPic($rowID){
- $filename = moveUploadedFile($this->directory, $this->picture);
- // write to Picture database
- }
- public function getEmoji(){}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement