コード例 #1
0
ファイル: DoEdit.php プロジェクト: pldin601/HomeMusic
 public function doPost(JsonResponse $response, HttpPost $post)
 {
     $song_id = $post->get("song_id")->reject("")->get();
     $metadata = $post->get("metadata")->filter("is_array")->get();
     $result = count($metadata) == 0 ? array() : Songs::edit($song_id, $metadata);
     $response->write(["tracks" => $result]);
 }
コード例 #2
0
 public function __construct()
 {
     $this->sources = new Sequence();
     $this->sources->push(http\HttpGet::getInstance());
     $this->sources->push(http\HttpPut::getInstance());
     $this->sources->push(http\HttpPost::getInstance());
     $this->sources->push(router\RouteArgs::getInstance());
 }
コード例 #3
0
ファイル: AbstractForm.php プロジェクト: pldin601/HomeMusic
 function __construct()
 {
     $post = HttpPost::getInstance();
     /** @var \ReflectionProperty $property */
     foreach ((new \ReflectionClass($this))->getProperties() as $property) {
         if ($property->isStatic() || substr($property->getName(), 0, 1) == "_") {
             continue;
         }
         $property->setAccessible(true);
         $property->setValue($this, $post->get($property->getName()));
     }
     $this->validate();
 }