Browse Source

Add back $name and __construct() to Type classes.

Refs https://github.com/cakephp/cakephp/pull/9885/files#r93180545
ADmad 9 years ago
parent
commit
796a12db02

+ 22 - 0
src/Database/Type/BinaryType.php

@@ -28,6 +28,28 @@ use PDO;
  */
 class BinaryType extends Type implements TypeInterface
 {
+    /**
+     * Identifier name for this type.
+     *
+     * (This property is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @var string|null
+     */
+    protected $_name = null;
+
+    /**
+     * Constructor.
+     *
+     * (This method is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @param string|null $name The name identifying this type
+     */
+    public function __construct($name = null)
+    {
+        $this->_name = $name;
+    }
 
     /**
      * Convert binary data into the database format.

+ 22 - 0
src/Database/Type/BoolType.php

@@ -27,6 +27,28 @@ use PDO;
  */
 class BoolType extends Type implements TypeInterface
 {
+    /**
+     * Identifier name for this type.
+     *
+     * (This property is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @var string|null
+     */
+    protected $_name = null;
+
+    /**
+     * Constructor.
+     *
+     * (This method is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @param string|null $name The name identifying this type
+     */
+    public function __construct($name = null)
+    {
+        $this->_name = $name;
+    }
 
     /**
      * Convert bool data into the database format.

+ 10 - 1
src/Database/Type/DateTimeType.php

@@ -29,6 +29,15 @@ use RuntimeException;
  */
 class DateTimeType extends Type implements TypeInterface
 {
+    /**
+     * Identifier name for this type.
+     *
+     * (This property is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @var string|null
+     */
+    protected $_name = null;
 
     /**
      * The class to use for representing date objects
@@ -83,7 +92,7 @@ class DateTimeType extends Type implements TypeInterface
      */
     public function __construct($name = null)
     {
-        parent::__construct($name);
+        $this->_name = $name;
 
         $this->_setClassName(static::$dateTimeClass, 'DateTime');
     }

+ 22 - 0
src/Database/Type/DecimalType.php

@@ -28,6 +28,28 @@ use RuntimeException;
  */
 class DecimalType extends Type implements TypeInterface
 {
+    /**
+     * Identifier name for this type.
+     *
+     * (This property is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @var string|null
+     */
+    protected $_name = null;
+
+    /**
+     * Constructor.
+     *
+     * (This method is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @param string|null $name The name identifying this type
+     */
+    public function __construct($name = null)
+    {
+        $this->_name = $name;
+    }
 
     /**
      * The class to use for representing number objects

+ 22 - 0
src/Database/Type/FloatType.php

@@ -27,6 +27,28 @@ use RuntimeException;
  */
 class FloatType extends Type implements TypeInterface
 {
+    /**
+     * Identifier name for this type.
+     *
+     * (This property is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @var string|null
+     */
+    protected $_name = null;
+
+    /**
+     * Constructor.
+     *
+     * (This method is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @param string|null $name The name identifying this type
+     */
+    public function __construct($name = null)
+    {
+        $this->_name = $name;
+    }
 
     /**
      * The class to use for representing number objects

+ 22 - 0
src/Database/Type/IntegerType.php

@@ -27,6 +27,28 @@ use PDO;
  */
 class IntegerType extends Type implements TypeInterface
 {
+    /**
+     * Identifier name for this type.
+     *
+     * (This property is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @var string|null
+     */
+    protected $_name = null;
+
+    /**
+     * Constructor.
+     *
+     * (This method is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @param string|null $name The name identifying this type
+     */
+    public function __construct($name = null)
+    {
+        $this->_name = $name;
+    }
 
     /**
      * Convert integer data into the database format.

+ 22 - 0
src/Database/Type/JsonType.php

@@ -27,6 +27,28 @@ use PDO;
  */
 class JsonType extends Type implements TypeInterface
 {
+    /**
+     * Identifier name for this type.
+     *
+     * (This property is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @var string|null
+     */
+    protected $_name = null;
+
+    /**
+     * Constructor.
+     *
+     * (This method is declared here again so that the inheritance from
+     * Cake\Database\Type can be removed in the future.)
+     *
+     * @param string|null $name The name identifying this type
+     */
+    public function __construct($name = null)
+    {
+        $this->_name = $name;
+    }
 
     /**
      * Convert a value data into a JSON string