Example #1
0
 /**
  * Find all distinct values of a property in the collection
  *
  * @param $property
  *
  * @return array
  */
 public function distinct($property)
 {
     if ($this->isEmpty()) {
         $select = new SelectClause();
         $select->setDistinct(true);
         $select->addField($property);
         $originalClause = $this->_query->getClause('SELECT');
         $this->_query->addClause($select);
         $results = $this->_getDataStore()->getData($this->_query);
         $this->_query->addClause($originalClause);
         if (empty($results)) {
             return [];
         }
         return Arrays::ipull($results, $property);
     }
     return parent::distinct($property);
 }
Example #2
0
 /**
  * @param null $daoClass
  *
  * @return static
  */
 public static function create($daoClass = null)
 {
     if ($daoClass === null) {
         $daoClass = MockCqlDao::class;
     }
     return parent::create($daoClass);
 }