Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

setters should provide fluent interface #804

Merged
merged 1 commit into from

3 participants

@Gamesh

setNew, setDeleted and resetModified should return $this as all the other setters to provide fluent interface.

@Gamesh Gamesh setters should provide fluent interface
setNew, setDeleted and resetModified should return $this as all the other setters to provide fluent interface.
13505a8
@staabm
Collaborator

you should provide unit tests supporting your change

@Gamesh Gamesh referenced this pull request from a commit in Gamesh/Propel
@Gamesh Gamesh Providing tests for proposal #804 30690de
@staabm
Collaborator

Looks good to me, including the tests :+1:

@willdurand willdurand merged commit 1eda8f3 into from
@staabm staabm referenced this pull request from a commit in staabm/Propel
@Gamesh Gamesh Providing tests for proposal #804 3818509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 18, 2013
  1. @Gamesh

    setters should provide fluent interface

    Gamesh authored
    setNew, setDeleted and resetModified should return $this as all the other setters to provide fluent interface.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 2 deletions.
  1. +6 −2 runtime/lib/om/BaseObject.php
View
8 runtime/lib/om/BaseObject.php
@@ -116,10 +116,12 @@ public function isNew()
* by Propel-generated children and Peers.
*
* @param boolean $b the state of the object.
+ * @return self
*/
public function setNew($b)
{
$this->_new = (boolean) $b;
+ return $this;
}
/**
@@ -137,11 +139,12 @@ public function isDeleted()
*
* @param boolean $b The deleted state of this object.
*
- * @return void
+ * @return self
*/
public function setDeleted($b)
{
$this->_deleted = (boolean) $b;
+ return $this;
}
/**
@@ -242,7 +245,7 @@ public function postHydrate($row, $startcol = 0, $rehydrate = false)
*
* @param string $col If supplied, only the specified column is reset.
*
- * @return void
+ * @return self
*/
public function resetModified($col = null)
{
@@ -253,6 +256,7 @@ public function resetModified($col = null)
} else {
$this->modifiedColumns = array();
}
+ return $this;
}
/**
Something went wrong with that request. Please try again.