parent
34f58dcded
commit
6f5ca2d29a
2 changed files with 20 additions and 2 deletions
|
@ -181,10 +181,28 @@ class EventController extends Controller
|
||||||
* @Method("GET")
|
* @Method("GET")
|
||||||
* @Template("CalciferBundle:Event:edit.html.twig")
|
* @Template("CalciferBundle:Event:edit.html.twig")
|
||||||
*/
|
*/
|
||||||
public function newAction()
|
public function newAction(Request $request)
|
||||||
{
|
{
|
||||||
$entity = new Event();
|
$entity = new Event();
|
||||||
|
|
||||||
|
$entity->description = $request->get('description');
|
||||||
|
$entity->summary = $request->get('summary');
|
||||||
|
$entity->url = $request->get('url');
|
||||||
|
if (strlen($request->get('tags')) > 0) {
|
||||||
|
$tags = explode(",",$request->get('tags'));
|
||||||
|
foreach($tags as $tag) {
|
||||||
|
$_tag = new Tag();
|
||||||
|
$_tag->name = $tag;
|
||||||
|
$entity->tags[] = $_tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strlen($request->get('location')) > 0) {
|
||||||
|
$location = new Location();
|
||||||
|
$location->name = $request->get('location');
|
||||||
|
$entity->location = $location;
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'entity' => $entity,
|
'entity' => $entity,
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,7 +46,7 @@ abstract class BaseEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get($name) {
|
public function &__get($name) {
|
||||||
if (property_exists($this,$name)) {
|
if (property_exists($this,$name)) {
|
||||||
return $this->$name;
|
return $this->$name;
|
||||||
} else {
|
} else {
|
||||||
|
|
Reference in a new issue