Skip to content

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Nov 27, 2025

Remove personalization
Add constant tags
Reorder fetch modes in a more logical way
Update an example and make it runnable
Remove useless wrapping <para>
Use <simpara> when possible

Now I do wonder if it makes sense to detail this all here or if we should refer back to https://www.php.net/manual/en/pdo.constants.fetch-modes.php instead?

Remove personalization
Add constant tags
Reorder fetch modes in a more logical way
Update an example and make it runnable
Remove useless wrapping <para>
Use <simpara> when possible
</simpara>
<caution>
<simpara>
The properties that will be populated are <emphasis>not</emphasis>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean the column names or the values that were assigned before calling the constructor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the values, but the column names are not passed either to the constructor AFAIK?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, could you clarify this paragraph and say something along the lines that in either case no arguments are provided to the constructor?

Co-authored-by: Kamil Tekiela <[email protected]>
Comment on lines +89 to +91
If <constant>PDO::FETCH_CLASSTYPE</constant> is included,
the class to instantiate is determined by the value of the
first column.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this exists in the current version too, but where else would the name of the class come from? This method doesn't have a parameter to provide the name of a class. IMHO it can only come from PDO::FETCH_CLASSTYPE. Am I wrong?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this exists in the current version too, but where else would the name of the class come from? This method doesn't have a parameter to provide the name of a class. IMHO it can only come from PDO::FETCH_CLASSTYPE. Am I wrong?

Yeah good point, I guess we should cross ref with PDOStatement::fetchObject()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I guess one could also call $sth->setFetchMode(PDO::FETCH_CLASS, 'Fruit'); but in that case why pass an argument to fetch()? Can this maybe be clarified? Maybe something like: "Unless the class name was specified in setFetchMode, this mode needs to be combined withPDO::FETCH_CLASSTYPE?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants