Example #1
0
 public function __construct(\Maestro\Persistence\Map\Classmap $classMap, $index = NULL)
 {
     $this->classMap = $classMap;
     $this->baseObject = $this->classMap->getObject();
     $this->manager = PersistentManager::getInstance();
     $this->index = $index;
 }
Example #2
0
 public function __construct(ClassMap $fromClassMap, $name)
 {
     $this->manager = \Maestro\Persistence\PersistentManager::getInstance();
     $this->fromClassMap = $fromClassMap;
     $this->fromClassName = $fromClassMap->getName();
     $this->name = $name;
     $this->inverse = FALSE;
 }
Example #3
0
 public static function find($select = '*', $where = '', $orderBy = '')
 {
     $className = get_called_class();
     $classMap = PersistentManager::getInstance()->getClassMap($className);
     $criteria = new RetrieveCriteria($classMap);
     $criteria->select($select)->where($where)->orderBy($orderBy);
     return $criteria;
 }
Example #4
0
 public function __construct($name, $databaseName)
 {
     $this->name = $name;
     $p = strrpos($name, '\\');
     $this->namespace = substr($name, 0, $p);
     $this->databaseName = $databaseName;
     $this->manager = \Maestro\Persistence\PersistentManager::getInstance();
     $this->db = $this->manager->getConnection($databaseName);
     $this->platform = $this->db->getPlatform();
     $this->hasTypedAttribute = FALSE;
 }
 public function __construct($classMap = NULL)
 {
     $this->manager = \Maestro\Persistence\PersistentManager::getInstance();
     $this->setClassMap($classMap);
     // Fill tables with tableMaps
     // Create CriteriaCondition for the WHERE part of this criteria
     $this->whereCondition = $this->getNewCondition();
     //$this->whereCondition->setCriteria($this);
     // Create condition for the HAVING part of this criteria
     $this->havingCondition = $this->getNewCondition();
     //$this->havingCondition->setCriteria($this);
 }
Example #6
0
 public static function getTableName($className)
 {
     $manager = \Maestro\Persistence\PersistentManager::getInstance();
     $classMap = $manager->getClassMap($className);
     return $classMap->getTableName();
 }
 /**
  * Get Criteria
  *
  */
 public static function getCriteria($className = '')
 {
     $criteria = NULL;
     if ($className != '') {
         $manager = PersistentManager::getInstance();
         $classMap = $manager->getClassMap($className);
         $criteria = new RetrieveCriteria($classMap);
     }
     return $criteria;
 }