You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something I want to create are nested classes depending of another one, which have a One to One relationship. The main idea is acting as a unique reference to the parent object and allow in these way to modify only the "nested class" if it's necessary in the future.
From my point of view, this give me the power to split big classes into smaller ones that are part of the bigger one.
In my case I need to define something close to:
classMember
{
// related to a person, whith his own attributes/** * The certification category of this user. * Normally is only one. * * @var Certification * @ORM\OneToOne(targetEntity="Certification", mappedBy="mainMember") **/private$certification;
publicfunction__construct()
{
$this->certification = newCertification($this);
// Create Certification class with this Member as a parameter
}
Certification will store strings as differents id's for each certification the user will have
classCertification
{
// other attributes/** * The certification owner, because there is only one * * @var Member * @ORM\OneToOne(targetEntity="Member", inversedBy="certification") **/protected$mainMember;
publicfunction__construct($mainMember)
{
$this->mainMember = $mainMember; //We receive the id of the member$mainMember->setCertification($this); //We tell the member to refer to this certification
}
I read previous issues like #22 or #223 and something I would like and I don't know if it would be possible to accomplish without overriding methods of EasyAdminBundle is:
Be able to upload fixtures with this architecture
Be able to create Member and then create the Certification automaticatelly
Some troubles I had before are:
When creating a New Member - 500 Internal Error: Entities passed to the
choice field must be managed. Maybe persist them in the entity manager? [Error
Trace](https://gist.github.com/ipesanz/39b5591038f2b491c9e04dcb87b863a3)
When creating a New Certification - 500 Internal Error: Type error: Too few
arguments to function AppBundle\Entity\Certification::__construct(), 0 passed in
/home/isaac/work/easy-admin-demo/vendor/javiereguiluz/easyadmin-
bundle/Controller/AdminController.php on line 429 and exactly 1 expected [Error
Trace](https://gist.github.com/ipesanz/8ab2224cba2e2d21fb513a923b9f2158)
Questions:
Which is the best way to configure .yml files and DinamicallyParsedConstructors used in EasyAdmin to these cases.
If I have to override constructors or controllers for one specific class, which would be the manner?
How can I handle with the Doctrine Entity Manager inside a Class? (extend its type instead of being only a Class type?
Exists other better ways to accomplish this although the classes are not being created at beginning (remember: I need to have only one Certificates instance for each member and not to modify it... it would be perfect if they have the same id)
The text was updated successfully, but these errors were encountered:
I don't know if it would be possible to accomplish this without overriding methods of EasyAdminBundle: be able to create Member and then create the Certification automatically.
Something I want to create are nested classes depending of another one, which have a One to One relationship. The main idea is acting as a unique reference to the parent object and allow in these way to modify only the "nested class" if it's necessary in the future.
From my point of view, this give me the power to split big classes into smaller ones that are part of the bigger one.
In my case I need to define something close to:
Certification will store strings as differents id's for each certification the user will have
I read previous issues like #22 or #223 and something I would like and I don't know if it would be possible to accomplish without overriding methods of EasyAdminBundle is:
Some troubles I had before are:
Questions:
The text was updated successfully, but these errors were encountered: