Map PDO PARAM_* constants to OCI constants
@param int $constant
@return int
326592
public function pdo2OciParamConst($constant) {
		switch($constant) {
			case SQLT_CLOB:
			case OCI_B_CLOB:
				$result = SQLT_CLOB;
				break;
			case SQLT_BLOB:
			case OCI_B_BLOB:
			case PDO::PARAM_LOB:
				$result = SQLT_BLOB;
				break;
			case OCI_B_CURSOR:
				$result = OCI_B_CURSOR;
				break;
			default:
				$result = SQLT_CHR;
				break;
		}

		return $result;
	}
343337
protected function getDataTypeByValue($value)
    {
        if(null === $value)
        {
            return \PDO::PARAM_NULL;
        }
        if(is_bool($value))
        {
            return \PDO::PARAM_BOOL;
        }
        if(is_int($value))
        {
            return \PDO::PARAM_INT;
        }
        return \PDO::PARAM_STR;
    }
1291720
private function inferType($value)
    {
        if (is_integer($value)) {
            return \PDO::PARAM_INT;
        }

        if (is_bool($value)) {
            return \PDO::PARAM_BOOL;
        }

        if (is_array($value)) {
            return is_integer(current($value))
                ? Connection::PARAM_INT_ARRAY
                : Connection::PARAM_STR_ARRAY;
        }

        return \PDO::PARAM_STR;
    }
66032
protected function setArray($constant)
    {
        if (strpos($this->input, '*') !== false) {
            $this->modeArray[] = $constant;

            $this->input = str_replace('*', '', $this->input);
        }

        return $this;
    }
863244
private function getConstantValue($constantName)
    {
        $serviceLocator = $this->getServiceLocator();
        if (!$serviceLocator instanceof ServiceLocatorInterface) {
            throw new common_exception_Error();
        }

        return $serviceLocator->get(common_ext_ExtensionsManager::SERVICE_ID)
            ->getExtensionById('tao')
            ->getConstant($constantName);
    }
978173
public final int getConstantIndex(float constant)
    {
        for (ConstantInfo ci : listConstantInfo(ConstantFloat.class))
        {
            ConstantFloat ic = (ConstantFloat) ci;
            if (Float.compare(constant, ic.getConstant()) == 0)
            {
                return constantPoolIndexMap.get(ci);
            }
        }
        return -1;
    }
350968
public function pdo(PDO $pdo = null)
    {
        if ($pdo) {
            $this->pdo = $pdo;
        }

        return $this->pdo;
    }
572865
public function geetParamTypeByValue($value)
	{
		switch(gettype($value))
		{
			case 'boolean':
				return PDO::PARAM_BOOL;
				break;
			case 'integer':
				return PDO::PARAM_INT;
				break;
			case 'NULL':
				return PDO::PARAM_NULL;
				break;
			default:
				return PDO::PARAM_STR;
				break;
		}
	}
538252
public static function createConst($constant)
    {
        $returnValue = null;

        
        $termConstClass = new core_kernel_classes_Class(RulesRdf::CLASS_TERM_CONST,__METHOD__);
		$termValueProperty = new core_kernel_classes_Property(RulesRdf::PROPERTY_TERM_VALUE,__METHOD__);
		$logicalOperatorProperty = new core_kernel_classes_Property(RulesRdf::PROPERTY_HASLOGICALOPERATOR,__METHOD__);
		$terminalExpressionProperty = new core_kernel_classes_Property(RulesRdf::PROPERTY_TERMINAL_EXPRESSION,__METHOD__);
        
		$label = 'Def Term Constant Label : ' . $constant;
		$comment = 'Def Term Constant Comment : '. $constant;
        $constantResource =  core_kernel_classes_ResourceFactory::create($termConstClass,$label , $comment);
        $returnValue = new core_kernel_rules_Term($constantResource->getUri());
        $returnValue->setPropertyValue($terminalExpressionProperty,$returnValue->getUri());
		$returnValue->setPropertyValue($logicalOperatorProperty,RulesRdf::INSTANCE_EXISTS_OPERATOR_URI);
		$returnValue->setPropertyValue($termValueProperty,$constant);
		$returnValue->debug = __METHOD__;
        

        return $returnValue;
    }
460987
public function getConstantSuffix()
    {
        $separator = PhpNameGenerator::STD_SEPARATOR_CHAR;
        return strtoupper(rtrim(preg_replace('/(\W|_)+/', $separator, $this->key), $separator));
    }
1199238
public static function count($where = null): int
    {
        $select = static::select();

        if ($where !== null) {
            if ($where instanceof Where) {
                $select->field('COUNT(*)', 'total');
                $select->where(clone $where);

            } else if (is_array($where)) {
                $select->field('COUNT(*)', 'total');
                foreach ($where as $field => $value) {
                    $select->where($field, $value);
                }

            } else if (!is_array(static::$primaryKey) && (is_numeric($where) || is_string($where))) {
                $select->field('COUNT(' . static::$primaryKey . ')', 'total');
                $select->where(static::$primaryKey, $where);

            }
        } else {
            $pk = is_string(static::$primaryKey) ? static::$primaryKey : '*';
            $select->field('COUNT(' . $pk . ')', 'total');
        }

        $results = $select->fetchAll();

        if (isset($results[0])) {
            $r = $results[0];
            if (array_key_exists('total', $r)) {
                return (int)$r['total'];
            } else {
                return 0;
            }
        } else {
            return 0;
        }
    }
97917
public static function getFromPDO(array $p_pdo_description)
    {
        $me = self::getNew();
        if (is_array($p_pdo_description)) {
            if (array_key_exists('name', $p_pdo_description)) {
                $me->setFldName($p_pdo_description['name']);
            }
            if (array_key_exists('len', $p_pdo_description)) {
                $me->setFldLength($p_pdo_description['len']);
            }
            if (array_key_exists('precision', $p_pdo_description)) {
                $me->setFldComplement($p_pdo_description['precision']);
            }
            $me->setFldType(FFCST::TYPE_STRING);
            if (array_key_exists('native_type', $p_pdo_description)) {
                switch (strtoupper($p_pdo_description['native_type'])) {
                    case 'LONGLONG':
                        $me->setFldType(FFCST::TYPE_BIGINT);
                        break;
                    case 'TINY':
                        $me->setFldType(FFCST::TYPE_INTEGER);
                        break;
                    case 'BLOB':
                        $me->setFldType(FFCST::TYPE_BLOB);
                        break;
                    case 'TIMESTAMP':
                        $me->setFldType(FFCST::TYPE_DATETIME);
                        break;
                }
            }
            if (array_key_exists('flags', $p_pdo_description)) {
                if (is_array($p_pdo_description['flags'])) {
                    foreach ($p_pdo_description['flags'] as $idx => $flag) {
                        if ($flag == 'primary_key') {
                            $me->setFldPrimary(true);
                        }
                        if ($flag == 'not_null') {
                            $me->setFldRequired(true);
                        }
                    }
                }
            }
        }
        return $me;
    }
1040602
private function Constant()
    {
        $identifier = $this->Identifier();

        if ( ! defined($identifier) && false !== strpos($identifier, '::') && '\\' !== $identifier[0]) {
            list($className, $const) = explode('::', $identifier);

            $pos = strpos($className, '\\');
            $alias = (false === $pos) ? $className : substr($className, 0, $pos);
            $found = false;
            $loweredAlias = strtolower($alias);

            switch (true) {
                case !empty ($this->namespaces):
                    foreach ($this->namespaces as $ns) {
                        if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
                             $className = $ns.'\\'.$className;
                             $found = true;
                             break;
                        }
                    }
                    break;

                case isset($this->imports[$loweredAlias]):
                    $found     = true;
                    $className = (false !== $pos)
                        ? $this->imports[$loweredAlias] . substr($className, $pos)
                        : $this->imports[$loweredAlias];
                    break;

                default:
                    if(isset($this->imports['__NAMESPACE__'])) {
                        $ns = $this->imports['__NAMESPACE__'];

                        if (class_exists($ns.'\\'.$className) || interface_exists($ns.'\\'.$className)) {
                            $className = $ns.'\\'.$className;
                            $found = true;
                        }
                    }
                    break;
            }

            if ($found) {
                 $identifier = $className . '::' . $const;
            }
        }

        // checks if identifier ends with ::class, \strlen('::class') === 7
        $classPos = stripos($identifier, '::class');
        if ($classPos === strlen($identifier) - 7) {
            return substr($identifier, 0, $classPos);
        }

        if (!defined($identifier)) {
            throw AnnotationException::semanticalErrorConstants($identifier, $this->context);
        }

        return constant($identifier);
    }
554201
protected function bindParameter(PDOStatement $statement, int $key, $value): void
	{
		if(is_string($value))
		{
			$type = PDO::PARAM_STR;
		}
		elseif(is_int($value))
		{
			$type = PDO::PARAM_INT;
		}
		elseif(is_bool($value))
		{
			$type = PDO::PARAM_BOOL;
		}
		elseif(is_null($value))
		{
			$type = PDO::PARAM_NULL;
		}
		elseif(is_object($value) && $value instanceof TypeInterface)
		{
			$value = $value->getValue();

			$type = $value->getType();
		}
		elseif(is_resource($value))
		{
			$type = PDO::PARAM_LOB;
		}
		else
		{
			$type = PDO::PARAM_STR;
		}

		$statement->bindValue($key + 1, $value, $type);
	}
327775
public void ldc(String constant) throws IOException
    {
        int index = subClass.resolveConstantIndex(constant);
        super.ldc(index);
    }
813362
public function execBound(\PDOStatement $stmt, array $values)
    {
        $ord = 1;
        foreach ($values as $val) {

            if (is_bool($val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_BOOL);

            } elseif (is_resource($val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_LOB);

            } elseif ((string)$val === ((string)(int)$val)) {

                $stmt->bindValue($ord, $val, \PDO::PARAM_INT);

            } else {

                $stmt->bindValue($ord, $val, \PDO::PARAM_STR);
            }
            $ord++;
        }

        return $stmt->execute();
    }
716933
protected function prepare($query, $param)
    {
        /**
         * @var \PdoStatement $stmt
         */
        $stmt = $this->db->prepare($query);

        foreach ($param as $set) {
            if (isset($set['value']) || isset($set['name'])) {
                $value = &$set['value'];
                $key   = $set['name'];
            } else {
                $value = &$set[1];
                $key   = $set[0];
            }

            if (!$key) {
                continue;
            }
            $stmt->bindParam($key, $value);
        }

        return $stmt;
    }