Browse Source

Added hard deprecation warning for TableSchemaInterface::primaryKey() and ContextInterface::primaryKey()

Corey Taylor 6 years ago
parent
commit
ba47aed698

+ 2 - 0
src/Database/Schema/TableSchema.php

@@ -529,6 +529,8 @@ class TableSchema implements TableSchemaInterface, SqlGeneratorInterface
      */
     public function primaryKey(): array
     {
+        deprecationWarning('`TableSchema::primaryKey()` is deprecated. Use `TableSchema::getPrimaryKey()` instead.');
+
         return $this->getPrimarykey();
     }
 

+ 2 - 0
src/View/Form/ArrayContext.php

@@ -107,6 +107,8 @@ class ArrayContext implements ContextInterface
      */
     public function primaryKey(): array
     {
+        deprecationWarning('`ArrayContext::primaryKey()` is deprecated. Use `ArrayContext::getPrimaryKey()` instead.');
+
         return $this->getPrimaryKey();
     }
 

+ 2 - 0
src/View/Form/EntityContext.php

@@ -181,6 +181,8 @@ class EntityContext implements ContextInterface
      */
     public function primaryKey(): array
     {
+        deprecationWarning('`EntityContext::primaryKey()` is deprecated. Use `EntityContext::getPrimaryKey()` instead.');
+
         return (array)$this->_tables[$this->_rootName]->getPrimaryKey();
     }
 

+ 2 - 0
src/View/Form/FormContext.php

@@ -64,6 +64,8 @@ class FormContext implements ContextInterface
      */
     public function primaryKey(): array
     {
+        deprecationWarning('`FormContext::primaryKey()` is deprecated. Use `FormContext::getPrimaryKey()` instead.');
+
         return [];
     }
 

+ 2 - 0
src/View/Form/NullContext.php

@@ -52,6 +52,8 @@ class NullContext implements ContextInterface
      */
     public function primaryKey(): array
     {
+        deprecationWarning('`NullContext::primaryKey()` is deprecated. Use `NullContext::getPrimaryKey()` instead.');
+
         return [];
     }