/** * the filterCriteria will filter out all the doSelect methods - ONLY if the filter is turned on. * IMPORTANT - the filter is turend on by default and when switched off - should be turned on again manually . * * @param Criteria $criteria The Criteria object used to build the SELECT statement. */ protected static function attachCriteriaFilter(Criteria $criteria) { UploadTokenPeer::getCriteriaFilter()->applyFilter($criteria); }
/** * When using user session, restrict the peer to users tokens only */ protected function restrictPeerToCurrentUser() { if (!$this->getKs() || !$this->getKs()->isAdmin()) { UploadTokenPeer::getCriteriaFilter()->getFilter()->addAnd(UploadTokenPeer::KUSER_ID, $this->getKuser()->getId()); } }