Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Components/Columns/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ public function setFilterNumber()
}

/**
* @param \Nette\Forms\IControl $formControl
* @param \Nette\Forms\Control $formControl
* @return \Grido\Components\Filters\Custom
*/
public function setFilterCustom(\Nette\Forms\IControl $formControl)
public function setFilterCustom(\Nette\Forms\Control $formControl)
{
return $this->grid->addFilterCustom($this->getName(), $formControl);
}
Expand Down
12 changes: 6 additions & 6 deletions src/Components/Columns/Editable.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @author Jakub Kopřiva <kopriva.jakub@gmail.com>
* @author Petr Bugyík
*
* @property \Nette\Forms\IControl $editableControl
* @property \Nette\Forms\Control $editableControl
* @property callback $editableCallback
* @property callback $editableValueCallback
* @property callback $editableRowCallback
Expand All @@ -36,7 +36,7 @@ abstract class Editable extends Column
/** @var bool */
protected $editableDisabled = FALSE;

/** @var \Nette\Forms\IControl Custom control for inline editing */
/** @var \Nette\Forms\Control Custom control for inline editing */
protected $editableControl;

/** @var callback for custom handling with edited data; function($id, $newValue, $oldValue, Editable $column) {} */
Expand All @@ -51,10 +51,10 @@ abstract class Editable extends Column
/**
* Sets column as editable.
* @param callback $callback function($id, $newValue, $oldValue, Columns\Editable $column) {}
* @param \Nette\Forms\IControl $control
* @param \Nette\Forms\Control $control
* @return Editable
*/
public function setEditable($callback = NULL, \Nette\Forms\IControl $control = NULL)
public function setEditable($callback = NULL, \Nette\Forms\Control $control = NULL)
{
$this->editable = TRUE;
$this->setClientSideOptions();
Expand All @@ -67,10 +67,10 @@ public function setEditable($callback = NULL, \Nette\Forms\IControl $control = N

/**
* Sets control for inline editation.
* @param \Nette\Forms\IControl $control
* @param \Nette\Forms\Control $control
* @return Editable
*/
public function setEditableControl(\Nette\Forms\IControl $control)
public function setEditableControl(\Nette\Forms\Control $control)
{
$this->isEditable() ?: $this->setEditable();
$this->editableControl = $control;
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ public function addFilterNumber($name, $label)

/**
* @param string $name
* @param \Nette\Forms\IControl $formControl
* @param \Nette\Forms\Control $formControl
* @return Filters\Custom
*/
public function addFilterCustom($name, \Nette\Forms\IControl $formControl)
public function addFilterCustom($name, \Nette\Forms\Control $formControl)
{
return new Filters\Custom($this, $name, NULL, $formControl);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Components/Filters/Custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@
* @subpackage Components\Filters
* @author Petr Bugyík
*
* @property-read \Nette\Forms\IControl $formControl
* @property-read \Nette\Forms\Control $formControl
*/
class Custom extends Filter
{
/** @var \Nette\Forms\IControl */
/** @var \Nette\Forms\Control */
protected $formControl;

/**
* @param \Grido\Grid $grid
* @param string $name
* @param string $label
* @param \Nette\Forms\IControl $formControl
* @param \Nette\Forms\Control $formControl
*/
public function __construct($grid, $name, $label, \Nette\Forms\IControl $formControl)
public function __construct($grid, $name, $label, \Nette\Forms\Control $formControl)
{
$this->formControl = $formControl;

parent::__construct($grid, $name, $label);
}

/**
* @return \Nette\Forms\IControl
* @return \Nette\Forms\Control
* @internal
*/
public function getFormControl()
Expand Down
18 changes: 11 additions & 7 deletions src/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,15 +611,19 @@ public function getPaginator()
*/
public function getProperty($object, $name)
{
if ($object instanceof \Nette\Database\Table\IRow && \Nette\Utils\Strings::contains($name, '.')) {
$parts = explode('.', $name);
foreach ($parts as $item) {
if (is_object($object)) {
$object = $object->$item;
if ($object instanceof \Nette\Database\Table\IRow) {
if (\Nette\Utils\Strings::contains($name, '.')) {
$parts = explode('.', $name);
foreach ($parts as $item) {
if (is_object($object)) {
$object = $object->$item;
}
}
}

return $object;
return $object;
} else {
return $object->$name;
}
}

if (is_array($object)) {
Expand Down