Skip to content

Instantly share code, notes, and snippets.

@delbono
Created August 31, 2010 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delbono/558764 to your computer and use it in GitHub Desktop.
Save delbono/558764 to your computer and use it in GitHub Desktop.
<?php
class OrdinativiMenuItemDayTable extends Doctrine_Table
{
public static function getInstance()
{
return Doctrine_Core::getTable('OrdinativiMenuItemDay');
}
public function getWeekMenus( $menu_id )
{
$foods = Doctrine::getTable('OrdinativiMenuItemDay')
->createQuery('a')
->leftJoin('a.MenuItemDays m')
->where('a.menu_id = ? ', $menu_id )
->execute();
var_dump($food->getMenuId()); // funziona
var_dump($food->getName()); // non funziona (Doctrine_Record_UnknownPropertyException)
}
}
OrdinativiMenuItem:
actAs: { Timestampable: ~ }
columns:
menu_id: { type: integer, notnull: true, default: 0 }
name: { type: string(255), notnull: true }
type: { type: string(3) }
state: { type: integer, notnull: true, default: 0 }
enabled: { type: boolean, notnull: true, default: 0 }
relations:
OrdinativiMenuItemDays: { type: one, foreignType: many, class: OrdinativiMenuItemDay , local: id, foreign: item_id, onDelete: CASCADE, foreignAlias: MenuItemDays }
OrdinativiMenuItemDay:
actAs: { Timestampable: ~ }
columns:
menu_id: { type: integer, notnull: true, default: 0 }
item_id: { type: integer, notnull: true, default: 0 }
day: { type: integer(3), notnull: true, default: 0 }
week: { type: integer(3), notnull: true, default: 0 }
enabled: { type: boolean, notnull: true, default: 0 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment