doctrine / mongodb-odm

The Official PHP MongoDB ORM/ODM
https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/
MIT License
1.09k stars 502 forks source link

Improve documentation around custom types #2101

Open alcaeus opened 4 years ago

alcaeus commented 4 years ago

The Type::convertToDatabaseValue() and Type:: convertToPHPValue() specify that the methods receive a PHP and database type and return the opposite type. However, there are numerous instances where convertToPHPValue() is called with a PHP value. Built-in types all handle this gracefully, so we should document this in the method signatures as well.

We may also want to add a short section to the documentation on how to add a custom type.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

SenseException commented 4 years ago

I assume this part of the docs is meant: https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/reference/custom-mapping-types.html

Do we need to target a specific branch for the extended information?

alcaeus commented 4 years ago

This can be added to the lowest supported branch, which at the moment would be 1.3.x. I've added it to the roadmap to be triaged and to keep the Bot happy.