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

Update the comments of the method createQueryTo in ActiveRecordFactory so that the IDE can automatically identify the specific class of ActiveRecord #280

Merged
merged 51 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
12c3300
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
be499a5
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
3988dcc
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
424f841
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
b64dde5
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
0f680fe
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
594a222
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
08711a6
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
cb9db0e
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
044755d
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
fa7c4cb
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 9, 2023
0af5333
Update src/BaseActiveRecord.php
niqingyang Dec 10, 2023
baf1889
Update src/ActiveRecordInterface.php
niqingyang Dec 10, 2023
b479a12
Revert "Update src/ActiveRecordInterface.php"
niqingyang Dec 10, 2023
0af32f1
Revert "Update src/BaseActiveRecord.php"
niqingyang Dec 10, 2023
c84a97d
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 10, 2023
2b82b2b
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 10, 2023
32cc7b4
Update tests/Driver/Oracle/ActiveRecordTest.php
niqingyang Dec 11, 2023
8583269
Update tests/Driver/Pgsql/ActiveRecordTest.php
niqingyang Dec 11, 2023
e299dfa
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 11, 2023
1f86104
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 11, 2023
43f615b
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 11, 2023
418be7d
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 11, 2023
564e019
implement the interface ArrayableInterface for BaseActiveRecord
niqingyang Dec 11, 2023
20e8962
Merge branch 'yiisoft:master' into master
niqingyang Dec 19, 2023
a5ab133
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 19, 2023
ae57733
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 19, 2023
480c0e1
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 19, 2023
5044c91
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 19, 2023
8f360aa
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 19, 2023
0d4ccc0
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 19, 2023
64b5b31
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 19, 2023
d531911
Update src/ActiveRecordFactory.php
niqingyang Dec 27, 2023
c62cd19
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 29, 2023
f488291
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Dec 29, 2023
8430f4a
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Jan 2, 2024
491e8f2
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Jan 2, 2024
6ce2ce3
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Jan 2, 2024
f3158eb
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Jan 2, 2024
7950258
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Jan 2, 2024
919ccb1
Update the comments of the method createQueryTo in ActiveRecordFactor…
niqingyang Jan 2, 2024
2991192
Update src/ActiveQuery.php
niqingyang Jan 3, 2024
ec3a466
Update src/ActiveRecordFactory.php
niqingyang Jan 3, 2024
236c7af
Update src/BaseActiveRecord.php
niqingyang Jan 3, 2024
15e9484
Update src/BaseActiveRecord.php
niqingyang Jan 3, 2024
380e4dc
Update src/BaseActiveRecord.php
niqingyang Jan 3, 2024
80b1a83
Update src/BaseActiveRecord.php
niqingyang Jan 3, 2024
040a83a
Update src/BaseActiveRecord.php
niqingyang Jan 3, 2024
ff9f101
Update src/BaseActiveRecord.php
niqingyang Jan 3, 2024
801b80a
Update src/BaseActiveRecord.php
niqingyang Jan 3, 2024
71b35f2
Apply suggestions from code review
Tigrov Jan 3, 2024
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
3 changes: 3 additions & 0 deletions src/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ class ActiveQuery extends Query implements ActiveQueryInterface
private array $joinWith = [];
private ActiveRecordInterface|null $arInstance = null;

/**
* @psalm-param class-string<ActiveRecordInterface> $arClass
*/
final public function __construct(
protected string $arClass,
protected ConnectionInterface $db,
Expand Down
5 changes: 5 additions & 0 deletions src/ActiveRecordFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public function __construct(private Factory $factory)
* @throws InvalidConfigException
* @throws NotFoundException
* @throws NotInstantiableException
* @return ActiveRecordInterface
*
* @psalm-template T of ActiveRecordInterface
* @psalm-param class-string<T> $arClass
* @psalm-return T
*/
public function createAR(
string $arClass,
Expand Down
9 changes: 9 additions & 0 deletions src/BaseActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ public function hasAttribute($name): bool
* **this** AR class.
*
* @return ActiveQueryInterface The relational query object.
*
* @psalm-param class-string<ActiveRecordInterface> $class
*/
public function hasMany(string $class, array $link): ActiveQueryInterface
{
Expand Down Expand Up @@ -362,12 +364,17 @@ public function hasMany(string $class, array $link): ActiveQueryInterface
* **this** AR class.
*
* @return ActiveQueryInterface The relational query object.
*
* @psalm-param class-string<ActiveRecordInterface> $class
*/
public function hasOne(string $class, array $link): ActiveQueryInterface
{
return $this->createRelationQuery($class, $link, false);
}

/**
* @psalm-param class-string<ActiveRecordInterface> $arClass
*/
public function instantiateQuery(string $arClass): ActiveQueryInterface
{
return new ActiveQuery($arClass, $this->db, $this->arFactory);
Expand Down Expand Up @@ -1119,6 +1126,8 @@ private function setRelationDependencies(
* @param bool $multiple Whether this query represents a relation to more than one record.
*
* @return ActiveQueryInterface The relational query object.
*
* @psalm-param class-string<ActiveRecordInterface> $arClass

* {@see hasOne()}
* {@see hasMany()}
Expand Down
Loading