Skip to content
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

dataset: Typangaben wieder korrigiert #1454

Merged
merged 1 commit into from
Jan 8, 2024
Merged
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
22 changes: 17 additions & 5 deletions plugins/manager/lib/yform/manager/dataset.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public static function create(?string $table = null): self
return $dataset;
}

/** @return null|static */
public static function get(int $id, ?string $table = null): ?self
{
if ($id <= 0) {
Expand All @@ -81,6 +82,7 @@ public static function get(int $id, ?string $table = null): ?self

/**
* @throws rex_exception if dataset does not exist
* @return static
*/
public static function require(int $id, ?string $table = null): self
{
Expand All @@ -96,7 +98,7 @@ public static function require(int $id, ?string $table = null): self
}

/**
* @return static|rex_yform_manager_dataset
* @return static
*/
public static function getRaw(int $id, ?string $table = null): self
{
Expand Down Expand Up @@ -147,7 +149,7 @@ public static function query(?string $table = null): rex_yform_manager_query
}

/**
* @return null|static|rex_yform_manager_dataset
* @return null|static
*/
public static function queryOne(string $query, array $params = [], ?string $table = null): ?self
{
Expand Down Expand Up @@ -177,7 +179,7 @@ public static function queryOne(string $query, array $params = [], ?string $tabl
}

/**
* @return rex_yform_manager_collection<static>|rex_yform_manager_collection<rex_yform_manager_dataset>
* @return rex_yform_manager_collection<static>
*/
public static function queryCollection(string $query, array $params = [], ?string $table = null): rex_yform_manager_collection
{
Expand Down Expand Up @@ -212,11 +214,11 @@ public static function setModelClass(string $table, string $modelClass): void
}

/**
* @return null|class-string<self>
* @return null|class-string<static>
*/
public static function getModelClass(string $table): ?string
{
return self::$tableToModel[$table] ?? null;
return self::$tableToModel[$table] ?? null; // @phpstan-ignore-line
}

public function getTableName(): string
Expand Down Expand Up @@ -257,6 +259,7 @@ public function hasValue(string $key): bool
}

/**
* @param mixed $value
* @return $this
*/
public function setValue(string $key, $value): self
Expand All @@ -271,6 +274,9 @@ public function setValue(string $key, $value): self
return $this;
}

/**
* @return mixed
*/
public function getValue(string $key)
{
if ('id' === $key) {
Expand Down Expand Up @@ -649,11 +655,17 @@ public function __isset(string $key): bool
return $this->hasValue($key);
}

/**
* @return mixed
*/
public function __get(string $key)
{
return $this->getValue($key);
}

/**
* @param mixed $value
*/
public function __set(string $key, $value): void
{
$this->setValue($key, $value);
Expand Down
Loading