Looked everywhere but can't find an answer to my question. I'm wondering if its possible with doctrine (symfony) to save an array of strings without making an entity of it.
As an example: A single user has multiple mail addresses (one-to-many). I don't want to save any other meta data with the mail address. E.G.:
<?php
class User {
private $mailAddresses = array();
// ...
public function addEmailAddress($address) {
$this->mailAddresses[] = $address;
}
// ....
}
$user = new User();
$user->addEmailAddress('[email protected]');
$user->addEmailAddress('[email protected]');
$addresses - $user->getEmailAddresses();
// $addresses is a simple array like: array('[email protected]','[email protected]');
Is something like this possbile or do I have to create a UserEmailAddressEntity in order to use the one-to-many relation?