title: Use Custom Class for Doctrine Property
body: <p>Is there a way to use a custom class for a property within a Doctrine entity without creating a relationship?</p>
  
  <p>More specifically, I'm looking to create an entity called <code>TimeClockEvent</code> that has two properties: <code>$_punchIn</code> and <code>$_punchOut</code>. I would like those two properties to be of a type <code>TimeEvent</code> which only has a basic <code>DateTime</code> as a value, but has some manipulation methods on it to be able to get the value out in different ways. I would like to be able to map this directly to a <code>datetime</code> column in the database, rather than having to have a relationship between the two.</p>
  
  <p>Is this possible? I feel like I'm searching for the wrong terms, because the only thing I'm finding is how to create and do various things with custom repositories. I've included some partial examples to further illustrate what I am trying to achieve.</p>
  
  <h2>Desired Time Event:</h2>
  
  <pre><code>&lt;?php 
  
  class TimeEvent{
    /** @var $datetime \DateTime **/
    protected $_datetime;
  
    public function getUTCDateTime(){
        return $this-&gt;_datetime;
    }
  
    public function getDateTime($timezone)
    {
        $date = $this-&gt;_datetime;
        $date-&gt;setTimezone(new \DateTimeZone($timezone));
        return $date;
    }
  
    public function setDateTime(\DateTime $value = null){
      if(null === $value){
              $this-&gt;_datetime = new \DateTime('now', (new \DateTimeZone('UTC')));
              return $this;
          }
  
          $value-&gt;setTimezone(new \DateTimeZone('UTC'));
          $this-&gt;_datetime = $value;
          return $this;
    }
  }
  </code></pre>
  
  <h2>Desired TimeClockEvent:</h2>
  
  <pre><code>class TimeClockEvent{
    ...
    /**
    * @var $_punchIn TimeEvent
    * @ORM\Column(type="datetime")
    **/
    protected $_punchIn;
  
    /**
    * @var $_punchOut TimeEvent
    * @ORM\Column(type="datetime")
    **/
    protected $_punchOut;
    ...
  }
  </code></pre>