コード例 #1
0
 /**
  * @param f_peristentdocument_PersistentDocument $conditionOn
  * @return integer[]
  */
 private function getExcludeIds($conditionOn)
 {
     $excludeIds = array();
     if ($conditionOn instanceof form_persistentdocument_field) {
         $excludeIds = array($conditionOn->getId());
     } else {
         if ($conditionOn instanceof form_persistentdocument_group) {
             $query = form_FieldService::getInstance()->createQuery();
             $query->add(Restrictions::descendentOf($conditionOn->getId()));
             $query->setProjection(Projections::property('id'));
             $excludeIds = $query->findColumn('id');
         }
     }
     return $excludeIds;
 }
コード例 #2
0
 /**
  * Add a new row to the result set.
  * Param can also be a rdbms.Column, a property
  * projection will be assumed then.
  *
  * @param    rdbms.SQLRenderable projection
  * @param    string alias optional
  * @return   rdbms.criterion.ProjectionList
  */
 public function add(SQLRenderable $projection, $alias = '')
 {
     $this->projections[] = array('alias' => empty($alias) && $projection instanceof CountProjection ? 'count' : $alias, 'projection' => $projection instanceof Projection ? $projection : ($projection = Projections::property($projection)));
     return $this;
 }
コード例 #3
0
 function withProjectionTest()
 {
     $crit = new Criteria();
     $this->assertClass($crit->withProjection(Projections::property(Job::column('job_id'))), 'rdbms.Criteria');
     $this->assertFalse($crit->isProjection());
     $this->assertTrue($crit->withProjection(Projections::property(Job::column('job_id')))->isProjection());
 }