Skip to content

Enabled dynamic datacallbacks #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

keesschepers
Copy link
Member

Feel free to comment again ;)

}

return $this->viewModel;
}

/**
* {@inheritDoc}
*/
protected function getItems(DataTable $dataTable, $offset, $limit)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good :). I think this method with its content could also be in the AbstractAdapter. The filterItems method can also be in the AbstractAdapter, but without using array_values. Then you will need to override filterItems because datatables expects an indexed array.

*
* @return ColumnBag
*/
public function setDataCallback($column, \Closure $callback)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't typehint \Closure here. If you do, you disallow things like array($myObject, 'someMethod'). Do no typehint + is_callable check instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants