Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I found the solution! In addition to mapping in yml, appropriate annotation in php classes also should be defined.</p> <p>Here is the content the necessary files:</p> <p>Params.mongodb.yml</p> <pre><code>Acme\StoreBundle\Document\Params: db: test type: document embedOne: param3: targetDocument: Param3 fields: id: id: true param2: type: string param4: type: float </code></pre> <p>Param3.mongodb.yml</p> <pre><code>Acme\StoreBundle\Document\Param3: db: test type: embeddedDocument fields: subparam31: type: float subparam32: type: float subparam33: type: float </code></pre> <p>Params.php</p> <pre><code>&lt;?php namespace Acme\StoreBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations; /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\Document */ class Params { /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\Id */ protected $id; /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\String */ protected $param2; /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\Float */ protected $param4; /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedOne(targetDocument="Param3") */ protected $param3; public function __construct($subparam31 = NULL, $subparam32 = NULL, $subparam33 = NULL) { $param3 = new Param3($subparam31, $subparam32, $subparam33); $this-&gt;setParam3($param3); } /** * Get id * * @return id $id */ public function getId() { return $this-&gt;id; } /** * Set param2 * * @param string $param2 * @return self */ public function setParam2($param2) { $this-&gt;param2 = $param2; return $this; } /** * Get param2 * * @return string $param2 */ public function getParam2() { return $this-&gt;param2; } /** * Set param4 * * @param float $param4 * @return self */ public function setParam4($param4) { $this-&gt;param4 = $param4; return $this; } /** * Get param4 * * @return float $param4 */ public function getParam4() { return $this-&gt;param4; } /** * Set param3 * * @param Acme\StoreBundle\Document\Param3 $param3 * @return self */ public function setParam3(\Acme\StoreBundle\Document\Param3 $param3) { $this-&gt;param3 = $param3; return $this; } /** * Get param3 * * @return Acme\StoreBundle\Document\Param3 $param3 */ public function getParam3($toArray = false) { if ($toArray) { if ($this-&gt;param3) { return $this-&gt;param3-&gt;toArray(); } } return $this-&gt;param3; } public function toArray() { return array( 'param3' =&gt; $this-&gt;getParam3(true) ); } </code></pre> <p>}</p> <p>Param3.php</p> <pre><code>&lt;?php namespace Acme\StoreBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations; /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\EmbeddedDocument */ class Param3 { /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\Float */ protected $subparam31; /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\Float */ protected $subparam32; /** * @Doctrine\ODM\MongoDB\Mapping\Annotations\Float */ protected $subparam33; public function __construct($subparam31 = NULL, $subparam32 = NULL, $subparam33 = NULL) { $this-&gt;subparam31 = $subparam31; $this-&gt;subparam32 = $subparam32; $this-&gt;subparam33 = $subparam33; } /** * Set subparam31 * * @param float $subparam31 * @return self */ public function setSubparam31($subparam31) { $this-&gt;subparam31 = $subparam31; return $this; } /** * Get subparam31 * * @return float $subparam31 */ public function getSubparam31() { return $this-&gt;subparam31; } /** * Set subparam32 * * @param float $subparam32 * @return self */ public function setSubparam32($subparam32) { $this-&gt;subparam32 = $subparam32; return $subparam32; } /** * Get subparam32 * * @return float $subparam32 */ public function getSubparam32() { return $this-&gt;subparam32; } /** * Set subparam33 * * @param float $subparam33 * @return self */ public function setSubparam33($subparam33) { $this-&gt;subparam33 = $subparam33; return $this; } /** * Get subparam33 * * @return float $subparam33 */ public function getSubparam33() { return $this-&gt;subparam33; } public function toArray() { return array( 'subparam31' =&gt; $this-&gt;getSubparam3(), 'subparam32' =&gt; $this-&gt;getSubparam32(), 'subparam33' =&gt; $this-&gt;getSubparam33() ); } </code></pre> <p>}</p> <p>This <a href="https://stackoverflow.com/questions/11065595/geospatial-indexing-no-mapping-found-for-field-with-yaml" title="question">question</a> helped me.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload