Beispiel #1
0
 public function performAction()
 {
     $album = Album::findByPrimaryKey($this->albumId);
     if (!$album) {
         throw new \Exception('Album not found');
     }
     $images = Image::statement()->where('? = ?', Image::columns()->albumId, $this->albumId)->query()->fetchAll();
     if ($images) {
         $this->response->addContent(new Rows(Processor::create($images)->map(function (Image $image) {
             $row = array();
             $row['Path'] = $image->path;
             $row['Url'] = $image->url;
             return $row;
         })));
     }
     $uploadHandler = Upload::createState();
     $uploadHandler->albumId = $this->albumId;
     $uploadUrl = (string) $this->io->makeAnchor($uploadHandler);
     $this->response->addContent(new Form($uploadUrl));
 }
Beispiel #2
0
 static function setUpDefinition(Definition $definition, $options)
 {
     $options->action = Option::create(EnumActions::create()->addToEnum(Catalog::definition(), '')->addToEnum(Create::definition())->addToEnum(Details::definition())->addToEnum(Upload::definition()))->setIsUnnamed()->setIsRequired();
 }