This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if($request->isXmlHttpRequest()) { | |
if (isset($date)) { | |
$date = date_create_from_format('y-m-d', $date); | |
//remove the training session row from the db for this user | |
$user = $this->get('security.context')->getToken()->getUser(); | |
$em = $this->getDoctrine()->getEntityManager(); | |
$query = $em->createQuery('SELECT ts from GymloopDiaryBundle:TrainingSession ts | |
WHERE ts.user = :user AND CAST(ts.date as DATE) = :date') | |
->setParameter('user', $user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isset($date)) { | |
$trainingSession = new TrainingSession(); | |
$user = $this->get('security.context')->getToken()->getUser(); | |
$trainingSession->setUser($user); | |
$date = date_create_from_format('d/m/y', $date); | |
$trainingSession->setDate($date); | |
$trainingSession->setStatus('pending'); | |
$trainingSession->setType('gym'); | |
$em = $this->getDoctrine()->getEntityManager(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
gymloop_profile_type: | |
class: Gymloop\CoreBundle\Form\ProfileFormType | |
tags: | |
- { name: form.type, alias: gymloop.profile.type } | |
arguments: [%fos_user.model.user.class%] | |
gymloop_profile_handler: | |
class: Gymloop\CoreBundle\Form\ProfileFormHandler | |
scope: request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the FOSUserBundle package. | |
* | |
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# this can be used to get an individual form value {{form.username.get('value') } #} | |
{#classes like input_large are from the formalize framework - see formalize.css#} | |
<form class="grid_6 prefix_1" action="{{ path('fos_user_profile_edit') }}" {{ form_enctype(form) }} method="POST" class="fos_user_profile_edit"> | |
{{ form_errors(form) }} | |
<div class="grid_2 alpha"> | |
{{ form_label(form.first_name, 'First Name: ') }} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the FOSUserBundle package. | |
* | |
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Gymloop\CoreBundle\Entity; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use FOS\UserBundle\Entity\User as BaseUser; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the FOSUserBundle package. | |
* | |
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the FOSUserBundle package. | |
* | |
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
date_format: m/D/y | |
services: | |
gymloop_profile_type: | |
class: Gymloop\CoreBundle\Form\ProfileFormType | |
tags: | |
- { name: form.type, alias: gymloop.profile.type } | |
arguments: [%fos_user.model.user.class%] | |