Browse Source

Merge pull request #7592 from cakephp/master-cosistent-fluent-interface

Correct method to fluent interface.
Mark Story 10 years ago
parent
commit
20c6265eb2
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/Datasource/EntityTrait.php

+ 4 - 2
src/Datasource/EntityTrait.php

@@ -582,7 +582,7 @@ trait EntityTrait
      * @param null|bool $isDirty true means the property was changed, false means
      * it was not changed and null will make the function return current state
      * for that property
-     * @return bool whether the property was changed or not
+     * @return bool Whether the property was changed or not
      */
     public function dirty($property = null, $isDirty = null)
     {
@@ -844,7 +844,7 @@ trait EntityTrait
      * this entity came from if it is known.
      *
      * @param string $alias the alias of the repository
-     * @return string
+     * @return string|$this
      */
     public function source($alias = null)
     {
@@ -852,6 +852,8 @@ trait EntityTrait
             return $this->_registryAlias;
         }
         $this->_registryAlias = $alias;
+
+        return $this;
     }
 
     /**