Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Add DBAL\TypeAwareObject. #193

Closed
wants to merge 1 commit into from

3 participants

Romain Geissler Don't Add Me To Your Organization a.k.a The Travis Bot Christophe Coevoet
Romain Geissler

This PR adds a common interface for custom object values that requires some PHP <-> SQL conversions, which allows to specify what DBAL type must be used for conversion.

Romain Geissler Romain-Geissler referenced this pull request in doctrine/doctrine2 August 29, 2012
Closed

Add DBAL\TypeAwareObject type inference. #432

Christophe Coevoet stof commented on the diff August 29, 2012
lib/Doctrine/DBAL/TypeAwareObject.php
... ...
@@ -0,0 +1,42 @@
  1
+<?php
  2
+/*
  3
+ *  $Id$
  4
+ *
1
Christophe Coevoet
stof added a note August 29, 2012

Tis SVN artifact should be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 29, 2012
lib/Doctrine/DBAL/TypeAwareObject.php
((3 lines not shown))
  3
+ *  $Id$
  4
+ *
  5
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  6
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  12
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16
+ *
  17
+ * This software consists of voluntary contributions made by many individuals
  18
+ * and is licensed under the LGPL. For more information, see
1
Christophe Coevoet
stof added a note August 29, 2012

this is wrong. DBAL switched to MIT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 29, 2012
lib/Doctrine/DBAL/TypeAwareObject.php
((14 lines not shown))
  14
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16
+ *
  17
+ * This software consists of voluntary contributions made by many individuals
  18
+ * and is licensed under the LGPL. For more information, see
  19
+ * <http://www.doctrine-project.org>.
  20
+ */
  21
+
  22
+namespace Doctrine\DBAL;
  23
+
  24
+/**
  25
+ * Interface for SQL loggers.
  26
+ *
  27
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  28
+ * @link    www.doctrine-project.org
  29
+ * @since   2.2.3
1
Christophe Coevoet
stof added a note August 29, 2012

this is wrong. new features won't be added in a bugfix release, and the phpdoc is wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 29, 2012
lib/Doctrine/DBAL/TypeAwareObject.php
((18 lines not shown))
  18
+ * and is licensed under the LGPL. For more information, see
  19
+ * <http://www.doctrine-project.org>.
  20
+ */
  21
+
  22
+namespace Doctrine\DBAL;
  23
+
  24
+/**
  25
+ * Interface for SQL loggers.
  26
+ *
  27
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  28
+ * @link    www.doctrine-project.org
  29
+ * @since   2.2.3
  30
+ * @version $Revision$
  31
+ */
  32
+
  33
+interface TypeAwareObject{
1
Christophe Coevoet
stof added a note August 29, 2012

the curly brace should be on its own line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Christophe Coevoet stof commented on the diff August 29, 2012
lib/Doctrine/DBAL/TypeAwareObject.php
((17 lines not shown))
  17
+ * This software consists of voluntary contributions made by many individuals
  18
+ * and is licensed under the LGPL. For more information, see
  19
+ * <http://www.doctrine-project.org>.
  20
+ */
  21
+
  22
+namespace Doctrine\DBAL;
  23
+
  24
+/**
  25
+ * Interface for SQL loggers.
  26
+ *
  27
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  28
+ * @link    www.doctrine-project.org
  29
+ * @since   2.2.3
  30
+ * @version $Revision$
  31
+ */
  32
+
1
Christophe Coevoet
stof added a note August 29, 2012

the empty line between the phpdoc and the declaration should be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged 14d6a8c into 24ec194).

Don't Add Me To Your Organization a.k.a The Travis Bot

This pull request passes (merged 14d6a8c into 24ec194).

Romain Geissler Romain-Geissler closed this August 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 29, 2012
Romain Geissler Add DBAL\TypeAwareObject. 14d6a8c
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 42 additions and 0 deletions. Show diff stats Hide diff stats

  1. 42  lib/Doctrine/DBAL/TypeAwareObject.php
42  lib/Doctrine/DBAL/TypeAwareObject.php
... ...
@@ -0,0 +1,42 @@
  1
+<?php
  2
+/*
  3
+ *  $Id$
  4
+ *
  5
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  6
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  7
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  8
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  9
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  11
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  12
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  14
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  15
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  16
+ *
  17
+ * This software consists of voluntary contributions made by many individuals
  18
+ * and is licensed under the LGPL. For more information, see
  19
+ * <http://www.doctrine-project.org>.
  20
+ */
  21
+
  22
+namespace Doctrine\DBAL;
  23
+
  24
+/**
  25
+ * Interface for SQL loggers.
  26
+ *
  27
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
  28
+ * @link    www.doctrine-project.org
  29
+ * @since   2.2.3
  30
+ * @version $Revision$
  31
+ */
  32
+
  33
+interface TypeAwareObject{
  34
+    /**
  35
+     * Return DBAL type of this object, it must a compatible constant:
  36
+     * - Type (\Doctrine\DBAL\Types\Type::*)
  37
+     * - Connection (\Doctrine\DBAL\Connection::PARAM_*)
  38
+     *
  39
+     * @return mixed This object type constant
  40
+     */
  41
+     public function getDBALType();
  42
+}
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.