Note that there are some explanatory texts on larger screens.

plurals
  1. POCould not load other mapping of entity in doctrine2 and zend 1
    primarykey
    data
    text
    <p>Anyone, please help for me this issue. I'm the newbie of Doctrine. After some time to configure the doctrine(version 2.3) working with zend(version 1.10.8). All working fine except the last step. I have a table "test table" like this</p> <pre><code> CREATE TABLE IF NOT EXISTS `testtable` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(250) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ; INSERT INTO `testtable` (`id`, `name`) VALUES (1, 'test1'), (2, 'what'); </code></pre> <p>This is the Entity annotations</p> <pre><code>&lt;?php use Doctrine\ORM\Mapping as ORM; /** * @ORM\Table(name="testtable") * @ORM\Entity * */ class Tallcat_Doctrine_Entity_Test { /** * @ORM\Column(type="string") */ private $name; /** * @ORM\Id @ORM\Column * @ORM\GeneratedValue */ private $id; /** * @param string $name */ public function setName($name) { $this-&gt;name = (string)$name; } /** * @return string */ public function getName() { return $this-&gt;name; } } </code></pre> <p><strong>And in the controller of zend, i call this for testing:</strong></p> <p> <pre><code>class DoctrineController extends Zend_Controller_Action { protected $em = null; public function init() { $this-&gt;em = \Zend_Registry::get('doctrine')-&gt;getEntityManager(); } public function indexAction() { try{ $test = new Tallcat_Doctrine_Entity_Test(); $testMap = $this-&gt;em-&gt;getRepository('Tallcat_Doctrine_Entity_Test')- &gt;findAll(); echo '&lt;pre&gt;'; print_r($testMap); echo '&lt;/pre&gt;'; die(); }catch(Exception $ex) { print_r($ex);die(); } } } </code></pre> <p>And this is the result:</p> <pre><code>Array ( [0] =&gt; Tallcat_Doctrine_Entity_Test Object ( [name:Tallcat_Doctrine_Entity_Test:private] =&gt; [id:Tallcat_Doctrine_Entity_Test:private] =&gt; 1 ) [1] =&gt; Tallcat_Doctrine_Entity_Test Object ( [name:Tallcat_Doctrine_Entity_Test:private] =&gt; [id:Tallcat_Doctrine_Entity_Test:private] =&gt; 2 ) ) </code></pre> <p>I don't know what wrong with the file name, it cannot load. I tried to save one record, it can save the Id, except the file Name. Someone could help please.</p>
    singulars
    1. This table or related slice is empty.
    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. 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