Пример #1
0
 public function postEdit()
 {
     $postData = $this->request()->postVariables();
     $newCategory = new Platform();
     $newCategory->hydrateFromUnserialized($postData);
     $newCategory->saveChanges();
     $msg = new \stdClass();
     $msg->type = 'success';
     $msg->text = 'Platform was successfully updated';
     Redirect::to('/' . $this->baseUri())->with('msg', $msg)->now();
 }
Пример #2
0
 /**
  * Add example platforms
  *
  * @return $this
  */
 protected function _addPlatforms()
 {
     echo 'Adding Platforms: ';
     $platformNames = array('Generic', 'Windows', 'Linux', 'Mac', 'Android', 'iPhone', 'iPad', 'Blackberry');
     foreach ($platformNames as $platformName) {
         $platform = new Platform();
         $platform->name = $platformName;
         $platform->description = $this->_getExampleContent(rand(4, 6));
         $platform->saveChanges();
     }
     echo count($platformNames) . PHP_EOL;
     return $this;
 }