Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions phpstan-baseline.neon

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
<code>$fk-&gt;isParentChild</code>
</UndefinedPropertyAssignment>
</file>
<file src="src/Propel/Generator/Behavior/Versionable/VersionableBehavior.php">
<UndefinedPropertyAssignment occurrences="1">
<code>$versionTable-&gt;isVersionTable</code>
</UndefinedPropertyAssignment>
</file>
<file src="src/Propel/Generator/Builder/DataModelBuilder.php">
<InvalidArgument occurrences="1">
<code>$this</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function modifyDatabase(): void
// don't add the same behavior twice
continue;
}
if (property_exists($table, 'isVersionTable')) {
if ($table->isAVersionTable()) {
// don't add the behavior to version tables
continue;
}
Expand Down Expand Up @@ -150,7 +150,7 @@ protected function addVersionTable(): void
'skipSql' => $table->isSkipSql(),
'identifierQuoting' => $table->isIdentifierQuotingEnabled(),
]);
$versionTable->isVersionTable = true;
$versionTable->setAsVersionTable(true);
// every behavior adding a table should re-execute database behaviors
foreach ($database->getBehaviors() as $behavior) {
$behavior->modifyDatabase();
Expand Down
9 changes: 9 additions & 0 deletions src/Propel/Generator/Model/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class Table extends ScopedMappingModel implements IdMethod
protected bool $isCrossRef = false;

protected ?string $defaultStringFormat = null;
protected ?bool $isVersionTable = false;

/**
* Constructs a table object with a name
Expand Down Expand Up @@ -2302,4 +2303,12 @@ public function isConnectedWithTable(Table $table): bool
return $this->getForeignKeysReferencingTable($table->getName()) ||
$table->getForeignKeysReferencingTable($this->getName());
}

public function isAVersionTable(): bool {
return $this->isVersionTable;
}

public function setAsVersionTable(bool $isVersionTable): void {
$this->isVersionTable = $isVersionTable;
}
}
2 changes: 1 addition & 1 deletion src/Propel/Runtime/ActiveQuery/Criteria.php
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@
*/
public function clearSelectColumns()
{
$this->selectColumns = $this->asColumns = [];
$this->selectColumns = $this->asColumns = $this->select = [];

Check failure on line 1626 in src/Propel/Runtime/ActiveQuery/Criteria.php

View workflow job for this annotation

GitHub Actions / code-style-and-static-analysis

Access to an undefined property Propel\Runtime\ActiveQuery\Criteria::$select.

return $this;
}
Expand Down
20 changes: 10 additions & 10 deletions templates/Builder/Om/baseQueryClassHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
* - string $parentClass
* - string $entityNotFoundExceptionClass
* - string $unqualifiedClassName
*
*
* - bool $addTimestamp
* - string $propelVersion
*
*
* - Column[] $columns
* - string[] $relationNames (both ref and backref)
* - string[] $relatedTableQueryClassNames
* - string[] $relatedTableQueryClassNames
*/
?>

/**
* Base class that represents a query for the `<?= $tableName ?>` table.
*
<?php if ($tableDesc): ?>
* <?= $tableDesc ?>
* <?= $tableDesc ?>
*
<?php endif; ?>
<?php if ($addTimestamp): ?>
* This class was autogenerated by Propel <?= $propelVersion ?> on:
*
* <?= strftime('%c') ?>
* <?= date('%c') ?>
*
<?php endif; ?>
<?php foreach($columns as $column):?>
Expand Down Expand Up @@ -64,7 +64,7 @@
*
<?php endif; ?>
* @method <?= $modelClass ?>|null findOne(?ConnectionInterface $con = null) Return the first <?= $modelClass ?> matching the query
* @method <?= $modelClass ?> findOneOrCreate(?ConnectionInterface $con = null) Return the first <?= $modelClass ?> matching the query, or a new <?= $modelClass ?> object populated from the query conditions when no match is found
* @method <?= $modelClass ?> findOneOrCreate(?ConnectionInterface $con = null) `Return the first <?= $modelClass ?> matching the query, or a new <?= $modelClass ?> object populated from the query conditions when no match is found`
*
<?php foreach($columns as $column):?>
* @method <?= $modelClass ?>|null findOneBy<?= $column->getPhpName() ?>(<?= $column->getPhpType() ?> $<?= $column->getName() ?>) Return the first <?= $modelClass ?> filtered by the <?= $column->getName() ?> column
Expand All @@ -78,15 +78,15 @@
<?php endforeach;?>
*
* @method <?= $modelClass ?>[]|Collection find(?ConnectionInterface $con = null) Return <?= $modelClass ?> objects based on current ModelCriteria
* @psalm-method Collection&\Traversable<<?= $modelClass ?>> find(?ConnectionInterface $con = null) Return <?= $modelClass ?> objects based on current ModelCriteria
* @psalm-method \Collection&\Traversable<<?= $modelClass ?>> find(?ConnectionInterface $con = null) Return <?= $modelClass ?> objects based on current ModelCriteria
*
<?php foreach($columns as $column):?>
* @method <?= $modelClass ?>[]|Collection findBy<?= $column->getPhpName() ?>(<?= $column->getPhpType() ?>|array<<?= $column->getPhpType() ?>> $<?= $column->getName() ?>) Return <?= $modelClass ?> objects filtered by the <?= $column->getName() ?> column
* @psalm-method Collection&\Traversable<<?= $modelClass ?>> findBy<?= $column->getPhpName() ?>(<?= $column->getPhpType() ?>|array<<?= $column->getPhpType() ?>> $<?= $column->getName() ?>) Return <?= $modelClass ?> objects filtered by the <?= $column->getName() ?> column
* @method <?= $modelClass ?>[]|Collection findBy<?= $column->getPhpName() ?>(<?= $column->getPhpType() ?>|<?= $column->getPhpType() ?>[] $<?= $column->getName() ?>) Return <?= $modelClass ?> objects filtered by the <?= $column->getName() ?> column
* @psalm-method \Collection&\Traversable<<?= $modelClass ?>> findBy<?= $column->getPhpName() ?>(<?= $column->getPhpType() ?>|array<<?= $column->getPhpType() ?>> $<?= $column->getName() ?>) Return <?= $modelClass ?> objects filtered by the <?= $column->getName() ?> column
<?php endforeach;?>
*
* @method <?= $modelClass ?>[]|\Propel\Runtime\Util\PropelModelPager paginate($page = 1, $maxPerPage = 10, ?ConnectionInterface $con = null) Issue a SELECT query based on the current ModelCriteria and uses a page and a maximum number of results per page to compute an offset and a limit
* @psalm-method \Propel\Runtime\Util\PropelModelPager&\Traversable<<?= $modelClass ?>> paginate($page = 1, $maxPerPage = 10, ?ConnectionInterface $con = null) Issue a SELECT query based on the current ModelCriteria and uses a page and a maximum number of results per page to compute an offset and a limit
*/
abstract class <?= $unqualifiedClassName ?> extends <?= $parentClass ?>
abstract class <?= $unqualifiedClassName ?> extends <?= $parentClass ?>
{
Loading