Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR: Consistently use DataObjectInterface for saveInto() on FormFie…

…ld subclasses. Fixes E_STRICT notice
  • Loading branch information...
commit daab8f4cbc25825b69a087bd942674d0d692e425 1 parent f811103
@ajoneil ajoneil authored
View
2  forms/CheckboxSetField.php
@@ -175,7 +175,7 @@ function setValue($value, $obj = null) {
*
* @param DataObject $record The record to save into
*/
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
$fieldname = $this->name;
$relation = ($fieldname && $record && $record->hasMethod($fieldname)) ? $record->$fieldname() : null;
if($fieldname && $record && $relation && $relation instanceof RelationList) {
View
2  forms/ConfirmedPasswordField.php
@@ -286,7 +286,7 @@ function validate() {
* @param DataObject $record
* @return bool
*/
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
if(!$this->isSaveable()) return false;
if(!($this->canBeEmpty && !$this->value)) {
View
2  forms/FileField.php
@@ -123,7 +123,7 @@ function getAttributes() {
);
}
- public function saveInto(DataObject $record) {
+ public function saveInto(DataObjectInterface $record) {
if(!isset($_FILES[$this->name])) return false;
$fileClass = File::get_class_for_file_extension(pathinfo($_FILES[$this->name]['name'], PATHINFO_EXTENSION));
View
2  forms/HasManyComplexTableField.php
@@ -87,7 +87,7 @@ function getControllerID() {
return $this->controller->ID;
}
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
$fieldName = $this->name;
$saveDest = $record->$fieldName();
View
2  forms/HasOneComplexTableField.php
@@ -47,7 +47,7 @@ function getControllerJoinID() {
return $this->controller->{$this->joinField};
}
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
$fieldName = $this->name;
$fieldNameID = $fieldName . 'ID';
View
2  forms/HtmlEditorField.php
@@ -96,7 +96,7 @@ function getAttributes() {
);
}
- public function saveInto($record) {
+ public function saveInto(DataObjectInterface $record) {
if($record->escapeTypeForField($this->name) != 'xml') {
throw new Exception (
'HtmlEditorField->saveInto(): This field should save into a HTMLText or HTMLVarchar field.'
View
2  forms/ListboxField.php
@@ -169,7 +169,7 @@ function dataValue() {
*
* @param DataObject $record The record to save into
*/
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
if($this->multiple) {
$fieldname = $this->name;
$relation = ($fieldname && $record && $record->hasMethod($fieldname)) ? $record->$fieldname() : null;
View
2  forms/MoneyField.php
@@ -100,7 +100,7 @@ function setValue($val) {
*
* (see @link MoneyFieldTest_CustomSetter_Object for more information)
*/
- function saveInto($dataObject) {
+ function saveInto(DataObjectInterface $dataObject) {
$fieldName = $this->name;
if($dataObject->hasMethod("set$fieldName")) {
$dataObject->$fieldName = DBField::create_field('Money', array(
View
3  forms/PhoneNumberField.php
@@ -103,8 +103,7 @@ protected function parseValue() {
return $parts;
}
- public function saveInto( $record ) {
-
+ public function saveInto(DataObjectInterface $record) {
list( $countryCode, $areaCode, $phoneNumber, $extension ) = $this->parseValue();
$fieldName = $this->name;
View
2  forms/TableField.php
@@ -231,7 +231,7 @@ function FieldList() {
/**
* Saves the Dataobjects contained in the field
*/
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
// CMS sometimes tries to set the value to one.
if(is_array($this->value)){
$newFields = array();
View
2  forms/TreeMultiselectField.php
@@ -132,7 +132,7 @@ function Field() {
* Calls function $record->onChange($items) before saving to the assummed
* Component set.
*/
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
// Detect whether this field has actually been updated
if($this->value !== 'unchanged') {
$items = array();
View
2  security/PermissionCheckboxSetField.php
@@ -215,7 +215,7 @@ function Field() {
*
* @param DataObject $record
*/
- function saveInto(DataObject $record) {
+ function saveInto(DataObjectInterface $record) {
$fieldname = $this->name;
$managedClass = $this->managedClass;
Please sign in to comment.
Something went wrong with that request. Please try again.