Friday, 15 March 2013

php - Doctrine/Symfony: Entity with non-mapped property -


How do I add an asset to a Entity class, which is not mapped to the database needed ?

I need an asset for a temporary value, so the property should not be brought from the database or should not be maintained. It should not be a SQL-calculated value, I have to set it (and obtain) only within the php code.

Writing an asset without annotation is not associated with your database as an example of an entity user needed.

class user {/ ** * @ORM \ Id * @ORM \ Column (type = "integer") * @ORM \ generated value (strategy = "auto") * $ / protected $ Id; / ** * @ORM \ column (type = "array") * / protected $ username; Protected $ notPersistedProperty}

Hope it helps.


No comments:

Post a Comment