Skip to main content

Home/ foograde/ Group items tagged test

Rss Feed Group items tagged

federico balderas

Symfony - Delete and reload all database records for each test - Stack Overflow - 0 views

  •  
    "$doctrine = new sfDoctrineDropDbTask($configuration->getEventDispatcher(), new sfAnsiColorFormatter()); $doctrine->run(array(), array("--no-confirmation","--env=test")); $doctrine = new sfDoctrineBuildDbTask($configuration->getEventDispatcher(), new sfAnsiColorFormatter()); $doctrine->run(array(), array("--env=test")); $doctrine = new sfDoctrineInsertSqlTask($configuration->getEventDispatcher(), new sfAnsiColorFormatter()); $doctrine->run(array(), array("--env=test"));"
Fernando Vega

Doctrine - Doctrine ORM for PHP - Behaviors - 0 views

  • $newsItem = new NewsItem(); $newsItem->Translation['en']->title = 'some title'; $newsItem->Translation['en']->body = 'test'; $newsItem->Translation['fi']->title = 'joku otsikko'; $newsItem->Translation['fi']->body = 'test'; $newsItem->save();
    • Fernando Vega
       
      guardar un registri i18n con doctrine
Adán Muguiro

Doctrine NestedSet - 0 views

  • $treeObject = Doctrine_Core::getTable('Category')->getTree(); $rootColumnName = $treeObject->getAttribute('rootColumnName'); foreach ($treeObject->fetchRoots() as $root) { $options = array( 'root_id' => $root->$rootColumnName ); foreach($treeObject->fetchTree($options) as $node) { echo str_repeat(' ', $node['level']) . $node['name'] . "\n"; } }
    • Fernando Vega
       
      fetch para deplegar nodos padres e hijos con doctrine
  • First lets create the query we want to use to retrieve our tree data with: // test.php // ... $q = Doctrine_Query::create() ->select('c.name, p.name, m.name') ->from('Category c') ->leftJoin('c.HottestProduct p') ->leftJoin('p.Manufacturer m'); Now we need to set the above query as the base query for the tree: $treeObject = Doctrine_Core::getTable('Category')->getTree(); $treeObject->setBaseQuery($q); $tree = $treeObject->fetchTree(); There it is, the tree with all the related data you need, all in one query.
  •  
    Agregar una subconsulta a un objeto NestedSet
1 - 3 of 3
Showing 20 items per page