Skip to content
This repository has been archived by the owner on Aug 28, 2018. It is now read-only.

Problem with embedone document in a fixture odm #35

Open
djwatt3 opened this issue Feb 27, 2014 · 0 comments
Open

Problem with embedone document in a fixture odm #35

djwatt3 opened this issue Feb 27, 2014 · 0 comments

Comments

@djwatt3
Copy link

djwatt3 commented Feb 27, 2014

model: Acme\AddressBundle\Document\Address
persistence: mongodb
fixtures:
Address1:
street: carnevale
city: napoli
province: napoli
zip: 80100

model: Acme\UserBundle\Document\User
persistence: mongodb
fixtures:
User1:
firstname: peppe
lastname: peppuzzo
address:
address: Address1

/* @mongodb\EmbedOne(targetDocument="Acme\AddressBundle\Document\Address")

  • @Assert\Type(type="Acme\AddressBundle\Document\Address", groups={"base_user"})
    • @Assert\Valid() */
      protected $address;

public function setAddress(\Acme\AddressBundle\Document\Address $address)
{
$this->address = $address;
return $this;
}

/** @mongodb\EmbeddedDocument */
class Address {
......................
}

PHP Catchable fatal error: Argument 1 passed to Acme\UserBundle\Document\User::setAddress() must be an instance of Acme\AddressBundle\Document\Address, array given, called in /......./vendor/khepin/yaml-fixtures-bundle/Khepin/YamlFixturesBundle/Fixture/MongoYamlFixture.php on line 70 and defined in /....../src/Acme/UserBundle/Document/User.php on line 107

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant