src/xPDO/xPDO.php
protected function sanitizePKCriteria($className, &$criteria) {
        if (is_scalar($criteria)) {
            $pkType = $this->getPKType($className);
            if (is_string($pkType)) {
                if (is_string($criteria) && !xPDOQuery::isValidClause($criteria)) {
                    $criteria = null;
                } else {
                    switch ($pkType) {
                        case 'int':
                        case 'integer':
                            $criteria = (int)$criteria;
                            break;
                        case 'string':
                            if (is_int($criteria)) {
                                $criteria = (string)$criteria;
                            }
                            break;
                    }
                }
            } elseif (is_array($pkType)) {
                $criteria = null;
            }
        }
    }
protected function sanitizePKCriteria($className, &$criteria) {
        if (is_scalar($criteria)) {
            $pkType = $this->getPKType($className);
            if (is_string($pkType)) {
                if (is_string($criteria) && !xPDOQuery::isValidClause($criteria)) {
                    $criteria = null;
                } else {
                    switch ($pkType) {
                        case 'int':
                        case 'integer':
                            $criteria = (int)$criteria;
                            break;
                        case 'string':
                            if (is_int($criteria)) {
                                $criteria = (string)$criteria;
                            }
                            break;
                    }
                }
            } elseif (is_array($pkType)) {
                $criteria = null;
            }
        }
    }
protected function sanitizePKCriteria ( $ className , & $ criteria ) { if ( is_scalar ( $ criteria ) ) { $ pkType = $ this -> getPKType ( $ className ) ; if ( is_string ( $ pkType ) ) { if ( is_string ( $ criteria ) && ! xPDOQuery :: isValidClause ( $ criteria ) ) { $ criteria = null ; } else { switch ( $ pkType ) { case 'int' : case 'integer' : $ criteria = ( int ) $ criteria ; break ; case 'string' : if ( is_int ( $ criteria ) ) { $ criteria = ( string ) $ criteria ; } break ; } } } elseif ( is_array ( $ pkType ) ) { $ criteria = null ; } } }
Sanitize criteria expected to represent primary key values.

@param string $className The name of the class.
@param mixed  &$criteria A reference to the criteria being used.
Sanitize criteria expected to represent primary key values .