Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2002

[GH-432] Add DBAL\TypeAwareObject type inference.

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      This issue is created automatically through a Github pull request on behalf of Romain-Geissler:

      Url: https://github.com/doctrine/doctrine2/pull/432

      Message:

      DBAL allows you to define custom field types for your entities, and those are seamlessly converted from PHP to SQL value. However, you can't those custom types as parameters without type hinting it :

      ```php
      $qb->select('e')
      ->from('Entity', 'e')
      ->where('e.customField = :customFieldValue')
      ->setParameter('customFieldValue',$customFieldValue,$customFieldDBALType);
      //this third argument is for now compulsory
      :
      ```

      In my case, ``$customFieldValue`` is an object that won't work well if converted with the default string type. I added a new DBAL interface (see doctrine/dbal#193 ) and tweaked the parameter type inference so that custom values can advertise their DBAL type.

      There is currently no way to dynamically override the parameter type inference logic, this is one design that allows it in some cases.

        Activity

        Benjamin Eberlei created issue -
        Hide
        Benjamin Eberlei added a comment -

        A related Github Pull-Request [GH-432] was closed
        https://github.com/doctrine/doctrine2/pull/432

        Show
        Benjamin Eberlei added a comment - A related Github Pull-Request [GH-432] was closed https://github.com/doctrine/doctrine2/pull/432
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Issue Type Bug [ 1 ] New Feature [ 2 ]
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-432] was closed:
        https://github.com/doctrine/dbal/pull/432

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-432] was closed: https://github.com/doctrine/dbal/pull/432

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2002, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: