/** * 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; }
public static function setup($dsn = null, $username = null, $password = null, $frozen = false) { parent::setup($dsn, $username, $password, $frozen); self::$x = new Rx_FindHelper(); }