Skip to main content

Home/ foograde/ Group items tagged doctrine

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"));"
federico balderas

Redo The Web » Comparing Propel, Doctrine and sfPropelFinder - 0 views

  •  
    "Retrieving an article by its primary key // Propel $article = ArticlePeer::retrieveByPk(123); // Doctrine $article = Doctrine::getTable('Article')->find(123); // sfPropelFinder $article = sfPropelFinder::from('Article')->findPk(123);"
  •  
    Comparacion de Propel y Doctrine
Adán Muguiro

Practical symfony | Día 3: El Modelo De Datos | symfony | Web PHP Framework - 0 views

  • php symfony doctrine:generate-module --with-show --non-verbose-templates frontend job JobeetJob
  •  
    Generando un módulo basado en una clase de 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
Adán Muguiro

Doctrine y select Max - 0 views

  • $this->linea = Doctrine_Query::create()    ->select('MAX(linea) AS linea')    ->from('Tabla')    ->execute();
  •  
    Hacer una consulta select max con doctrine
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
federico balderas

Symfony - Doctrine - Saving Many-To-Many (M:M) relationships | Me Like Dev - 0 views

  •  
    "01 Author: 02 tableName: author 03 columns: 04 ... 05 relations: 06 Book: 07 class: Book 08 refClass: LinkingAuthorBook #This will allow you to reference Book rows from an Author object 09 local: author_id #Local value refers to the current object, in this case Author 10 foreign: book_id #Foreign value refers to the object you wish to link to from Author, in this case Book 11 Book: 12 tableName: book 13 columns: 14 ... 15 relations: 16 Author: 17 class: Author 18 refClass: LinkingAuthorBook #This will allow you to reference Author rows from a Book object 19 local: book_id #Local value refers to the current object, in this case Author 20 foreign: author_id #Foreign value refers to the object you wish to link to from Book, in this case Author"
Fernando Vega

symfony framework forum: symfony 1.3 and 1.4 => is there anyone can tell me how to use ... - 0 views

  • in the form $this->widgetSchema['login_id'] = new sfWidgetFormJQueryAutocompleter(array( 'url' => '/ajax/getUser', )); and in the action of executeGetUser $this->getResponse()->setContentType('application/json'); $users=Doctrine::getTable('user')->getLoginIDList(); return $this->renderText(json_encode($users)); And in the userTable which inside Doctrine $q=Doctrine_Query::create()->select('login_id')->from('user')- >execute(); foreach($q as $row){ $login_id[$row->login_id]=$row->login_id; } return $login_id; hope this help =]
    • Fernando Vega
       
      autocompletar con doctrine y sf 1.4
Adán Muguiro

Incluir formularo i18n en un modelo - 1 views

  • public function configure() { unset( $this['jobeet_affiliates_list'], $this['created_at'], $this['updated_at'] );   $this->embedI18n(array('en', 'fr')); $this->widgetSchema->setLabel('en', 'English'); $this->widgetSchema->setLabel('fr', 'French'); }
  •  
    Codigo a pegar en el TablaForm de cierto modelo
1 - 10 of 10
Showing 20 items per page