title: One-to-Many Symfony Doctrine returns empty result
body: <p>In my code I have a table called Squares. A Square has many Assets. Squares has a column called msid, which is a squares id.</p>
  
  <p>In my Assets table I have a field called msid. This is the msid of the Square it belongs to.</p>
  
  <p>I'm trying to set up a One-to-Many/Many-to-One relationship, and it's just not working. I have no idea what it is, and I'm very new to symfony and Doctrine, so if you think of a solution, please don't skip steps.</p>
  
  <p>Thanks in advance, this is turning me off from this migration so fast.</p>
  
  <p>EDIT: I need to mention that I am not generating a new schema. I am migrating a schema currently in production to ORM.</p>
  
  <p>Assets.php</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * Assets
   *
   * @ORM\Table(name="assets")
   * @ORM\Entity
   */
  class Assets
  {
  
      /**
       * @ORM\ManyToOne(targetEntity="Squares", inversedBy="assets")
       */
      private $square;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="msid", type="integer", nullable=false)
       */
      private $msid;
  
      /**
       * @var string
       *
       * @ORM\Column(name="name", type="string", length=64, nullable=false)
       */
      private $name;
  
      /**
       * @var string
       *
       * @ORM\Column(name="type", type="string", length=32, nullable=false)
       */
      private $type;
  
      /**
       * @var string
       *
       * @ORM\Column(name="data", type="string", length=4096, nullable=false)
       */
      private $data;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="assetid", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $assetid;
  
      /**
       * Set msid
       *
       * @param integer $msid
       *
       * @return Assets
       */
      public function setMsid($msid)
      {
          $this-&gt;msid = $msid;
  
          return $this;
      }
  
      /**
       * Get msid
       *
       * @return integer
       */
      public function getMsid()
      {
          return $this-&gt;msid;
      }
  
      /**
       * Set name
       *
       * @param string $name
       *
       * @return Assets
       */
      public function setName($name)
      {
          $this-&gt;name = $name;
  
          return $this;
      }
  
      /**
       * Get name
       *
       * @return string
       */
      public function getName()
      {
          return $this-&gt;name;
      }
  
      /**
       * Set type
       *
       * @param string $type
       *
       * @return Assets
       */
      public function setType($type)
      {
          $this-&gt;type = $type;
  
          return $this;
      }
  
      /**
       * Get type
       *
       * @return string
       */
      public function getType()
      {
          return $this-&gt;type;
      }
  
      /**
       * Set data
       *
       * @param string $data
       *
       * @return Assets
       */
      public function setData($data)
      {
          $this-&gt;data = $data;
  
          return $this;
      }
  
      /**
       * Get data
       *
       * @return string
       */
      public function getData()
      {
          return $this-&gt;data;
      }
  
      /**
       * Get assetid
       *
       * @return integer
       */
      public function getAssetid()
      {
          return $this-&gt;assetid;
      }
  }
  </code></pre>
  
  <p>Assets.SQL</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `assets` (
    `assetid` int(5) NOT NULL AUTO_INCREMENT,
    `msid` int(5) NOT NULL,
    `name` varchar(64) NOT NULL,
    `type` varchar(32) NOT NULL,
    `data` varchar(4096) NOT NULL,
    PRIMARY KEY (`assetid`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8092 ;
  </code></pre>
  
  <p>Squares.php</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  use Doctrine\Common\Collections\ArrayCollection;
  
  /**
   * Squares
   *
   * @ORM\Table(name="squares")
   * @ORM\Entity(repositoryClass="AppBundle\Repository\SquaresRepository")
   */
  class Squares
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="userid", type="integer", nullable=false)
       */
      private $userid;
  
      /**
       * @var boolean
       *
       * @ORM\Column(name="squaretype", type="boolean", nullable=false)
       */
      private $squaretype;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="published", type="datetime", nullable=false)
       */
      private $published = 'CURRENT_TIMESTAMP';
  
      /**
       * @var integer
       *
       * @ORM\Column(name="msid", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $msid;
  
      /**
       * @ORM\OneToMany(targetEntity="Assets", mappedBy="square")
       */
      private $assets;
  
      public function __construct()
      {
          $this-&gt;assets = new ArrayCollection();
      }
  
      // other getters setters here ...
  
      /**
       * Get assets
       *
       * @return ArrayCollection
       */
      public function getAssets()
      {
          return $this-&gt;assets;
      }
  
      /**
       * Set assets
       *
       * @param ArrayCollection $assets
       *
       * @return Squares
       */
      public function setAssets($assets)
      {
          $this-&gt;assets = $assets;
  
          return $this;
      }
  </code></pre>
  
  <p>Squares SQL</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `squares` (
    `msid` int(11) NOT NULL AUTO_INCREMENT,
    `userid` int(5) NOT NULL,
    `squaretype` tinyint(4) NOT NULL,
    `published` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `package` text NOT NULL,
    `counter` int(10) unsigned NOT NULL DEFAULT '0',
    `firstname` varchar(20) NOT NULL,
    `middlename` varchar(20) NOT NULL,
    `lastname` varchar(20) NOT NULL,
    `age` tinyint(1) DEFAULT NULL,
    `dob` text NOT NULL,
    `dod` text NOT NULL,
    `city` varchar(32) NOT NULL,
    `state` varchar(13) NOT NULL,
    `zip` int(5) NOT NULL,
    `sex` varchar(1) NOT NULL,
    `bio` text NOT NULL,
    `service` text NOT NULL,
    `picture` int(11) DEFAULT NULL,
    `video` text,
    `videoexp` date DEFAULT NULL,
    `videoReady` tinyint(1) NOT NULL,
    `videoCounter` int(10) unsigned NOT NULL DEFAULT '0',
    `vidIntro` text,
    `vidMusic` text,
    `vidBackground` text,
    `dualfirst` varchar(20) NOT NULL,
    `dualmiddle` varchar(20) NOT NULL,
    `duallast` varchar(20) NOT NULL,
    `dualdob` text NOT NULL,
    `dualdod` text NOT NULL,
    `dualpicture` int(11) DEFAULT NULL,
    `couplesname` varchar(50) NOT NULL,
    `birthday1` text,
    `birthday2` text,
    `visible` tinyint(4) NOT NULL DEFAULT '0',
    `verified` tinyint(1) NOT NULL,
    `fhName` varchar(256) NOT NULL,
    `fhPhone` varchar(20) NOT NULL,
    `fhLink` varchar(128) NOT NULL,
    `clientid` int(4) unsigned zerofill NOT NULL,
    PRIMARY KEY (`msid`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10364 ;
  </code></pre>