lib/MongoLite/Database.php
public function registerCriteriaFunction($criteria) {

        $id = \uniqid('criteria');

        if (\is_callable($criteria)) {
           $this->document_criterias[$id] = $criteria;
           return $id;
        }

        if (is_array($criteria)) {

            $fn = null;

            eval('$fn = function($document) { return '.UtilArrayQuery::buildCondition($criteria).'; };');

            $this->document_criterias[$id] = $fn;

            return $id;
        }

        return null;
    }
public function registerCriteriaFunction($criteria) {

        $id = \uniqid('criteria');

        if (\is_callable($criteria)) {
           $this->document_criterias[$id] = $criteria;
           return $id;
        }

        if (is_array($criteria)) {

            $fn = null;

            eval('$fn = function($document) { return '.UtilArrayQuery::buildCondition($criteria).'; };');

            $this->document_criterias[$id] = $fn;

            return $id;
        }

        return null;
    }
public function registerCriteriaFunction ( $ criteria ) { $ id = \ uniqid ( 'criteria' ) ; if ( \ is_callable ( $ criteria ) ) { $ this -> document_criterias [ $ id ] = $ criteria ; return $ id ; } if ( is_array ( $ criteria ) ) { $ fn = null ; eval ( '$fn = function($document) { return ' . UtilArrayQuery :: buildCondition ( $ criteria ) . '; };' ) ; $ this -> document_criterias [ $ id ] = $ fn ; return $ id ; } return null ; }
Register Criteria function

@param  mixed $criteria
@return mixed
Register Criteria function