Beispiel #1
0
 /**
  * Pretty much the same as find(), just for counting beans
  *
  * @return int
  */
 public function count()
 {
     if (empty($this->related)) {
         $r = R::count($this->type, $this->makeQuery(), $this->params);
     } else {
         $r = 0;
         foreach ($this->related as $bean) {
             $r += R::relatedCount($bean, $this->type, $this->makeQuery(), $this->params);
         }
     }
     $this->free();
     return $r;
 }