title: Implementing a Custom Field on a Doctrine Entity
body: <p>I have an <code>Attachment</code> Entity in Doctrine which references a file on Amazon S3. I need to be able to provide a sort of 'Calculated Field' on the Entity that works out what I call the <code>downloadpath</code>. The <code>downloadpath</code> would be a calculated URL, for example <a href="http://site.s3.amazon.com/%s/attach/%s" rel="nofollow">http://site.s3.amazon.com/%s/attach/%s</a> where I need to replace the two string values with values on the entity itself (account and filename), so; </p>
  
  <p><a href="http://site.s3.amazon.com/1/attach/test1234.txt" rel="nofollow">http://site.s3.amazon.com/1/attach/test1234.txt</a></p>
  
  <p>Although we use a Service Layer, I'd like the <code>downloadpath</code> to be available on the Entity at all times without it having to pass through the SL.</p>
  
  <p>I've considered the obvious route of adding say a constant to the Entity;</p>
  
  <p><code>const DOWNLOAD_PATH = 'http://site.s3.amazon.com/%s/attach/%s';</code> and a custom <code>getDownloadPath()</code> but I'd like to keep specifics like this URL in my app's configuration, not the Entities class (also, see update below)</p>
  
  <p>Does anyone have any ideas on how I could achieve this?</p>
  
  <p><strong>UPDATE</strong> To add to this, I am aware now that I would need to generate a temporary URL with the AmazonS3 library to allow temporary authed access to the file - I'd prefer not to make a static call to our Amazon/Attachment Service to do this as It just doesn't feel right.</p>