Example #1
0
    public function getAction($version, $uuid)
    {
        try {
            $query = new Query('
			SELECT
				uuid,
				created_at,
				updated_at,
				name,
				mime_type,
				is_deleted,
				is_image,
				is_ready,
				size
			FROM Depot\\Models\\File
			WHERE uuid = :uuid:
			LIMIT 1
			', $this->getDI());
            $query->setUniqueRow(true);
            $file = $query->execute(array('uuid' => $uuid));
            if (!$file) {
                throw new Exception('File not found', 404);
            }
            $this->response->setJsonContent(array('status' => 'OK', 'result' => $file));
            $this->response->send();
        } catch (\Exception $exception) {
            $this->throwException($exception);
        }
    }