title: Symfony Workflow Component Prolem... Marking Does not Exist
body: <p>I am trying to learn how to use the Workflow Component</p>
  
  <p>On this line in DefaultController.py (far below):</p>
  
  <pre><code>$service-&gt;apply($loginMessage, 'message_shown');
  </code></pre>
  
  <p>I get the message</p>
  
  <pre><code>Neither the property "marking" nor one of the methods "getMarking()", "marking()", "isMarking()", "hasMarking()", "__get()" exist and have public access in class "UserFlowBundle\Entity\LoginMessage".
  500 Internal Server Error - NoSuchPropertyException 
  </code></pre>
  
  <p>What could be causing the error? My code is very similar to the <a href="https://github.com/lyrixx/SFLive-Paris2016-Workflow" rel="nofollow noreferrer">SFLive Example</a>, and I can't see what the difference is.</p>
  
  <p>LoginModal.php</p>
  
  <pre><code>&lt;?php
  
  namespace UserFlowBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * LoginMessage
   *
   * @ORM\Table(name="login_message")
   * @ORM\Entity(repositoryClass="UserFlowBundle\Repository\LoginMessageRepository")
   */
  class LoginMessage
  {
  
  
      public function __construct($user)
      {
          $this-&gt;user = $user;
          $this-&gt;state = 'none';
      }
  
      /**
       * @var int
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @var string
       *
       * @ORM\Column(name="state", type="string", length=255)
       */
      private $state;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user", type="string", length=255, unique=true)
       */
      private $user;
  
  
      /**
       * Get id
       *
       * @return int
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
      /**
       * Set state
       *
       * @param string $state
       *
       * @return LoginMessage
       */
      public function setState($state)
      {
          $this-&gt;state = $state;
  
          return $this;
      }
  
      /**
       * Get state
       *
       * @return string
       */
      public function getState()
      {
          return $this-&gt;state;
      }
  
      /**
       * Set user
       *
       * @param string $user
       *
       * @return LoginMessage
       */
      public function setUser($user)
      {
          $this-&gt;user = $user;
  
          return $this;
      }
  
      /**
       * Get user
       *
       * @return string
       */
      public function getUser()
      {
          return $this-&gt;user;
      }
  }
  </code></pre>
  
  <p>DefaultController.py</p>
  
  <pre><code>  &lt;?php
      namespace UserFlowBundle\Controller;
      use Symfony\Bundle\FrameworkBundle\Controller\Controller;
      use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
      use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
      use Symfony\Component\HttpFoundation\Request;
      /**
       * @Route("/userflow")
       */
      class DefaultController extends Controller
      {
          /**
           * @Route("/")
           */
          public function indexAction()
          {
              $user = $this-&gt;get('security.token_storage')-&gt;getToken()-&gt;getUser();
              return $this-&gt;render('UserFlowBundle:Default:index.html.twig', ['user'=&gt;$user]);
          }
  
          /**
           * @Route("/apply-transition/", name="user_flow_apply_transition")
           * @Method("POST")
           */
          public function applyTransitionAction(Request $request)
          {
              try {
                  $user = $this-&gt;get('security.token_storage')-&gt;getToken()-&gt;getUser();
                  $em = $this-&gt;get('doctrine')-&gt;getManager();
                  $repository = $em-&gt;getRepository('UserFlowBundle:LoginMessage');
                  $loginMessage = $repository-&gt;findOneOrCreateByUser($user);
                  $service = $this-&gt;get('state_machine.loginModal');
                  $service-&gt;apply($loginMessage, 'message_shown');
                  #$service-&gt;apply($loginMessage, $request-&gt;request-&gt;get('transition'));
                  $this-&gt;get('doctrine')-&gt;getManager()-&gt;flush();
              } catch (ExceptionInterface $e) {
                  $this-&gt;get('session')-&gt;getFlashBag()-&gt;add('danger', $e-&gt;getMessage());
              }
              return $this-&gt;redirect(
                  $this-&gt;generateUrl('task_show', ['id' =&gt; 1])
              );
          }
  
      }
  </code></pre>