-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs: use canonical order for phpdoc tags, add missed semicolon
- Loading branch information
1 parent
15ec77f
commit 9fca118
Showing
5 changed files
with
42 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ Advanced field value conversion using custom mapping types | |
.. sectionauthor:: Jan Sorgalla <[email protected]> | ||
|
||
When creating entities, you sometimes have the need to transform field values | ||
before they are saved to the database. In Doctrine you can use Custom Mapping | ||
before they are saved to the database. In Doctrine you can use Custom Mapping | ||
Types to solve this (see: :ref:`reference-basic-mapping-custom-mapping-types`). | ||
|
||
There are several ways to achieve this: converting the value inside the Type | ||
|
@@ -15,7 +15,7 @@ type `Point <https://dev.mysql.com/doc/refman/8.0/en/gis-class-point.html>`_. | |
|
||
The ``Point`` type is part of the `Spatial extension <https://dev.mysql.com/doc/refman/8.0/en/spatial-extensions.html>`_ | ||
of MySQL and enables you to store a single location in a coordinate space by | ||
using x and y coordinates. You can use the Point type to store a | ||
using x and y coordinates. You can use the Point type to store a | ||
longitude/latitude pair to represent a geographic location. | ||
|
||
The entity | ||
|
@@ -29,9 +29,9 @@ The entity class: | |
.. code-block:: php | ||
<?php | ||
namespace Geo\Entity; | ||
/** | ||
* @Entity | ||
*/ | ||
|
@@ -84,15 +84,15 @@ The entity class: | |
} | ||
} | ||
We use the custom type ``point`` in the ``@Column`` docblock annotation of the | ||
We use the custom type ``point`` in the ``@Column`` docblock annotation of the | ||
``$point`` field. We will create this custom mapping type in the next chapter. | ||
|
||
The point class: | ||
|
||
.. code-block:: php | ||
<?php | ||
namespace Geo\ValueObject; | ||
class Point | ||
|
@@ -196,7 +196,7 @@ The format of the string representation format is called | |
`Well-known text (WKT) <https://en.wikipedia.org/wiki/Well-known_text>`_. | ||
The advantage of this format is, that it is both human readable and parsable by MySQL. | ||
|
||
Internally, MySQL stores geometry values in a binary format that is not | ||
Internally, MySQL stores geometry values in a binary format that is not | ||
identical to the WKT format. So, we need to let MySQL transform the WKT | ||
representation into its internal format. | ||
|
||
|
@@ -210,13 +210,13 @@ which convert WKT strings to and from the internal format of MySQL. | |
|
||
.. note:: | ||
|
||
When using DQL queries, the ``convertToPHPValueSQL`` and | ||
When using DQL queries, the ``convertToPHPValueSQL`` and | ||
``convertToDatabaseValueSQL`` methods only apply to identification variables | ||
and path expressions in SELECT clauses. Expressions in WHERE clauses are | ||
and path expressions in SELECT clauses. Expressions in WHERE clauses are | ||
**not** wrapped! | ||
|
||
If you want to use Point values in WHERE clauses, you have to implement a | ||
:doc:`user defined function <dql-user-defined-functions>` for | ||
:doc:`user defined function <dql-user-defined-functions>` for | ||
``PointFromText``. | ||
|
||
Example usage | ||
|
@@ -252,5 +252,5 @@ Example usage | |
$query = $em->createQuery("SELECT l FROM Geo\Entity\Location l WHERE l.address = '1600 Amphitheatre Parkway, Mountain View, CA'"); | ||
$location = $query->getSingleResult(); | ||
/* @var Geo\ValueObject\Point */ | ||
/** @var Geo\ValueObject\Point */ | ||
$point = $location->getPoint(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters