-
Notifications
You must be signed in to change notification settings - Fork 0
Overloading
final class MySqlComponent extends \Masala\SqlBuilder implements IMySqlComponentFactory {
public function handleState(): void {
$this->state();
$this->state->rows = \stdClass;
foreach($this->database->query($this->query, ...$this->arguments)->fetchAll() as $key => $row) {
...application logic...
$this->state->rows->$key = $row;
}
final class MyMongoComponentGrid extends MongoBuilder implements IMyMongoComponentFactory {
public function handleState(): void {
$this->state();
$this->state->rows = \stdClass;
foreach($this->client->selectCollection($this->database, $this->collection)->find($this->arguments, $this->options) as $key => $row) {
...application logic...
$this->state->rows->$key = $row;
}
public function props(): array {
$props = parent::props();
$props['edit'] = ['label' => $this->translatorRepository->translate('save changes'), 'link' => $this->link('edit')];
$props['remove'] = ['link' => $this->link('remove')];
$props['new'] = ['label' => $this->translatorRepository->translate('save changes'), 'link' => $this->link('new')];
return $props;
}