Could not find anything on this - it seems that it should be direct, though.
So, an example of Doctrine2 docs for type conversion by related parameters is as follows:
$date = new \DateTime("2011-03-05 14:00:21"); $stmt = $conn->prepare("SELECT * FROM articles WHERE publish_date > ?"); $stmt->bindValue(1, $date, "datetime"); $stmt->execute();
What I want to do is specify a type conversion for one of the columns, but nothing was found in the documents or in StackOverflow. A pseudo-example of how this might look:
$stmt = $conn -> prepare("SELECT datetime FROM articles WHERE id = 1"); $stmt -> setType(0, "date_type");
If anyone knows how to do this (this is SQL not DQL), I would really appreciate it. Thanks.
source share