src/Valkyrja/ORM/Repositories/PDORepository.php
protected function setPropertiesForSaveCreateDeleteStatement(PDOStatement $statement, array $properties): void
    {
        // Iterate through the properties
        foreach ($properties as $column => $property) {
            if ($property === null) {
                continue;
            }

            // If the property is an object, then serialize it
            if (\is_object($property)) {
                $property = \serialize($property);
            } // Otherwise json encode if its an array
            elseif (\is_array($property)) {
                $property = \json_encode($property);
            }

            $type = PDO::PARAM_STR;

            if (\is_int($property) || \is_bool($property)) {
                $type     = PDO::PARAM_INT;
                $property = (int) $property;
            }

            // Bind each column's value to the statement
            $statement->bindValue($this->columnParam($column), $property, $type);
        }
    }
protected function setPropertiesForSaveCreateDeleteStatement(PDOStatement $statement, array $properties): void
    {
        // Iterate through the properties
        foreach ($properties as $column => $property) {
            if ($property === null) {
                continue;
            }

            // If the property is an object, then serialize it
            if (\is_object($property)) {
                $property = \serialize($property);
            } // Otherwise json encode if its an array
            elseif (\is_array($property)) {
                $property = \json_encode($property);
            }

            $type = PDO::PARAM_STR;

            if (\is_int($property) || \is_bool($property)) {
                $type     = PDO::PARAM_INT;
                $property = (int) $property;
            }

            // Bind each column's value to the statement
            $statement->bindValue($this->columnParam($column), $property, $type);
        }
    }
Set properties for save, create, or delete statements.

@param PDOStatement $statement
@param array        $properties

@return void