Skip to content

Commit

Permalink
adjust #83 for v3 and php8
Browse files Browse the repository at this point in the history
  • Loading branch information
koertho committed Apr 11, 2024
1 parent e3bda97 commit 1bfa83b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
8 changes: 7 additions & 1 deletion src/Dca/AuthorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ public static function getRegistrations(): array

protected static function createOptionObject(string $table): DcaFieldConfiguration|AuthorFieldConfiguration
{
return new AuthorFieldConfiguration($table);
$options = new AuthorFieldConfiguration($table);

$options->setExclude(true);
$options->setSearch(true);
$options->setFilter(true);

return $options;
}

protected static function storeConfig(DcaFieldConfiguration $config): void
Expand Down
3 changes: 0 additions & 3 deletions src/Dca/AuthorFieldConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ class AuthorFieldConfiguration extends DcaFieldConfiguration
protected string $type = AuthorField::TYPE_USER;
protected string $fieldNamePrefix = '';
protected bool $useDefaultLabel = true;
protected bool $exclude = true;
protected bool $search = true;
protected bool $filter = true;

public function setType(string $type): AuthorFieldConfiguration
{
Expand Down
20 changes: 6 additions & 14 deletions src/Dca/DcaFieldConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@

class DcaFieldConfiguration
{
/** @var null|int */
private $flag = null;

/** @var bool */
protected $exclude = false;

/** @var bool */
protected $search = false;

/** @var bool */
protected $filter = false;

/** @var bool */
protected $sorting = false;
private ?int $flag = null;
protected bool $exclude = false;
protected bool $search = false;
protected bool $filter = false;
protected bool $sorting = false;

/**
* @param string $table
*/
public function __construct(private string $table)
{

}

public function getTable(): string
Expand Down

0 comments on commit 1bfa83b

Please sign in to comment.