From 38e86f04d8ca7379c5fece498db268bb6755f880 Mon Sep 17 00:00:00 2001 From: Joe Harvey Date: Tue, 24 Jan 2017 15:56:51 +0000 Subject: [PATCH] Updating all setter methods on DBField to return an instance of themselves --- src/ORM/FieldType/DBField.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ORM/FieldType/DBField.php b/src/ORM/FieldType/DBField.php index 83bfb6a3c..4a777102b 100644 --- a/src/ORM/FieldType/DBField.php +++ b/src/ORM/FieldType/DBField.php @@ -148,7 +148,7 @@ abstract class DBField extends ViewableData * * @param string $name * - * @return DBField + * @return $this */ public function setName($name) { @@ -196,10 +196,12 @@ abstract class DBField extends ViewableData * @param bool $markChanged Indicate wether this field should be marked changed. * Set to FALSE if you are initializing this field after construction, rather * than setting a new value. + * @return $this */ public function setValue($value, $record = null, $markChanged = true) { $this->value = $value; + return $this; } /** @@ -446,7 +448,9 @@ abstract class DBField extends ViewableData { $fieldName = $this->name; if (empty($fieldName)) { - throw new \BadMethodCallException("DBField::saveInto() Called on a nameless '" . get_class($this) . "' object"); + throw new \BadMethodCallException( + "DBField::saveInto() Called on a nameless '" . get_class($this) . "' object" + ); } $dataObject->$fieldName = $this->value; }