ENHANCEMENT DataFormatter setters return for chaining

This commit is contained in:
Raissa North 2017-12-07 09:36:12 +13:00
parent 47ec185c12
commit 823d29f94a

View File

@ -189,10 +189,12 @@ abstract class DataFormatter
/** /**
* @param array $fields * @param array $fields
* @return $this
*/ */
public function setCustomFields($fields) public function setCustomFields($fields)
{ {
$this->customFields = $fields; $this->customFields = $fields;
return $this;
} }
/** /**
@ -205,18 +207,22 @@ abstract class DataFormatter
/** /**
* @param array $fields * @param array $fields
* @return $this
*/ */
public function setCustomAddFields($fields) public function setCustomAddFields($fields)
{ {
$this->customAddFields = $fields; $this->customAddFields = $fields;
return $this;
} }
/** /**
* @param array $relations * @param array $relations
* @return $this
*/ */
public function setCustomRelations($relations) public function setCustomRelations($relations)
{ {
$this->customRelations = $relations; $this->customRelations = $relations;
return $this;
} }
/** /**
@ -237,10 +243,12 @@ abstract class DataFormatter
/** /**
* @param array $fields * @param array $fields
* @return $this
*/ */
public function setRemoveFields($fields) public function setRemoveFields($fields)
{ {
$this->removeFields = $fields; $this->removeFields = $fields;
return $this;
} }
/** /**
@ -258,10 +266,12 @@ abstract class DataFormatter
/** /**
* @param int $size * @param int $size
* @return $this
*/ */
public function setTotalSize($size) public function setTotalSize($size)
{ {
$this->totalSize = (int)$size; $this->totalSize = (int)$size;
return $this;
} }
/** /**
@ -326,7 +336,6 @@ abstract class DataFormatter
abstract public function supportedMimeTypes(); abstract public function supportedMimeTypes();
/** /**
* Convert a single data object to this format. Return a string. * Convert a single data object to this format. Return a string.
*/ */