Lets say i have a view table. And i want to get data from it to an entity. Can i (and how) create entity class to do that. (no save operation needed). I just want to display
The accepted answer is correct, but I'd like to offer some additional suggestions that you might want to consider:
Mark your entity as read-only.
Make the constructor private so that only Doctrine can create instances.
/**
* @ORM\Entity(readOnly=true)
* @ORM\Table(name="your_view_table")
*/
class YourEntity {
private function __construct() {}
}