Minor. keyField -> keyFrom
This commit is contained in:
parent
c8f3c640b8
commit
4f00fbdbc6
|
|
@ -44,7 +44,7 @@ class RecordFinder extends FormWidgetBase
|
|||
/**
|
||||
* @var string Field name to use for key.
|
||||
*/
|
||||
public $keyField = 'id';
|
||||
public $keyFrom = 'id';
|
||||
|
||||
/**
|
||||
* @var string Relation column to display for the name
|
||||
|
|
@ -80,7 +80,7 @@ class RecordFinder extends FormWidgetBase
|
|||
$this->relationType = $this->model->getRelationType($this->relationName);
|
||||
|
||||
$this->prompt = $this->getConfig('prompt', 'Click the %s button to find a record');
|
||||
$this->keyField = $this->getConfig('keyField', $this->keyField);
|
||||
$this->keyFrom = $this->getConfig('keyFrom', $this->keyFrom);
|
||||
$this->nameFrom = $this->getConfig('nameFrom', $this->nameFrom);
|
||||
$this->descriptionFrom = $this->getConfig('descriptionFrom', $this->descriptionFrom);
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ class RecordFinder extends FormWidgetBase
|
|||
if (!$this->relationModel)
|
||||
return null;
|
||||
|
||||
return $this->relationModel->{$this->keyField};
|
||||
return $this->relationModel->{$this->keyFrom};
|
||||
}
|
||||
|
||||
public function getNameValue()
|
||||
|
|
|
|||
|
|
@ -242,8 +242,9 @@ class Form extends WidgetBase
|
|||
$this->model->fill($data);
|
||||
$this->data = (object) array_merge((array) $this->data, (array) $data);
|
||||
|
||||
foreach ($this->fields as $field)
|
||||
foreach ($this->fields as $field) {
|
||||
$field->value = $this->getFieldValue($field);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class Components extends FormWidgetBase
|
|||
{
|
||||
$components = $this->listComponents();
|
||||
|
||||
return $this->makePartial('formcomponents', ['components'=>$components]);
|
||||
return $this->makePartial('formcomponents', ['components' => $components]);
|
||||
}
|
||||
|
||||
protected function listComponents()
|
||||
|
|
@ -35,7 +35,7 @@ class Components extends FormWidgetBase
|
|||
|
||||
$manager = ComponentManager::instance();
|
||||
$manager->listComponents();
|
||||
foreach ($this->model->settings['components'] as $name=>$properties) {
|
||||
foreach ($this->model->settings['components'] as $name => $properties) {
|
||||
list($name, $alias) = strpos($name, ' ') ? explode(' ', $name) : [$name, $name];
|
||||
|
||||
try {
|
||||
|
|
@ -50,7 +50,8 @@ class Components extends FormWidgetBase
|
|||
if (isset($pluginDetails['icon']))
|
||||
$componentObj->pluginIcon = $pluginDetails['icon'];
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
$componentObj = new UnknownComponent(null, $properties, $ex->getMessage());
|
||||
$componentObj->alias = $alias;
|
||||
$componentObj->pluginIcon = 'icon-bug';
|
||||
|
|
|
|||
Loading…
Reference in New Issue