PDO Event Constants

I have a bit of a doubt about PHP with PDO constants. How do I use it? No documentation, no example, and no questions here.

Does anyone put this to work knows how to use it?

PDO::PARAM_EVT_FREE (integer)

 Deallocation event

PDO::PARAM_EVT_EXEC_PRE (integer)

 Event triggered prior to execution of a prepared statement.

PDO::PARAM_EVT_EXEC_POST (integer)

 Event triggered subsequent to execution of a prepared statement.

PDO::PARAM_EVT_FETCH_PRE (integer)

 Event triggered prior to fetching a result from a resultset.

PDO::PARAM_EVT_FETCH_POST (integer)

 Event triggered subsequent to fetching a result from a resultset.

PDO::PARAM_EVT_NORMALIZE (integer)

 Event triggered during bound parameter registration allowing the driver to normalize the parameter name.

      

http://php.net/manual/en/pdo.constants.php

+3


source to share


1 answer


These constants are not needed in PHP code and I don't think they will be very useful any time soon. As you can see here They are part of the internal PDO api. Event hooks are used internally to distinguish between drivers: the distribution of a prepared statement and its associated values ​​require different approaches to different drivers. (pay attention to macros #if PDO_USE_MYSQLND

and #else

)



They may have been added as class constants to allow users to submit callbacks for these events if they so desire. If so, I don't think this is considered a top priority for PDO developers, though ...
Bottom line: You can't use them, just ignore them

+3


source







All Articles