Welcome Guest, Not a member yet? Register   Sign In
Doctrine 2 integration
#1

[eluser]Unknown[/eluser]
Hi,

I successfully installed CI 2, HMVC(wiredesignz) and doctrine 2, selecting, inserting, editing is working as expected if i use orm but when I use query builder or native query i can't use ResultSetMapping because there is a error and this is part of my controller and error:

Code:
$this->doctrine=new Doctrine();
$em = $this->doctrine->em;
$test_model = new models\Tests;
$testing = $em->find('models\Tests', 3);
echo "Author: " . $testing->getName() . "\n";
print_r($testing);
$names=$test_model->getName(11);
var_dump($names);
echo 'Name: '.$testing->getName();
$new_test= $em->getRepository('models\Tests')->find(19);
print_r($new_test);

//set the entity to be managed by Doctrine
$this->doctrine->em->persist($test_model);        
$test_model->setName('Roberts');
$em->persist($test_model);

//persist the changes to database
$this->doctrine->em->flush();

$qb = $em->createQueryBuilder();
$q = $qb->update('models\Tests', 't')
    ->set('t.name', '?1')
    ->where('t.id = ?2')
    ->setParameter(1, 'Some name')
    ->setParameter(2,  6)
    ->getQuery();
$p = $q->execute();
print_r($p);

$rsm = new ResultSetMapping;
Fatal error: Class 'ResultSetMapping' not found

Since, above testing code works OK i think that autoloading works OK but if it can't find a class maybe not. I can't figure out what a hell is going on with this.

Thank You
#2

[eluser]Unknown[/eluser]
You may try:

$rsm = new Doctrine\ORM\Query\ResultSetMapping;
#3

[eluser]bluehat09[/eluser]
Finally, an easy installer that works in 5 minutes or less.
I have read a lot of tutorials to get Doctrine2 and CodeIgniter2 together but all seems to be very complicated.
I'm wondering why CodeIgniter or Doctrine doesn't have such integration packages on their websites?

http://www.tlswebsolutions.com/codeignit...neignited/

Many thanks!




Theme © iAndrew 2016 - Forum software by © MyBB