Skip to content

Commit

Permalink
[TASK] Renamed repository table constant name
Browse files Browse the repository at this point in the history
  • Loading branch information
hojalatheef committed Jan 9, 2025
1 parent ede4f07 commit c22260b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Classes/Domain/Repository/CompanyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*/
class CompanyRepository extends Repository implements HiddenRepositoryInterface
{
private const COMPANY_TABLE_NAME = 'tx_yellowpages2_domain_model_company';
private const TABLE = 'tx_yellowpages2_domain_model_company';

protected $defaultOrderings = [
'company' => QueryInterface::ORDER_ASCENDING,
Expand Down Expand Up @@ -169,12 +169,12 @@ public function findOlderThan(int $days): array
$today = time(); // Get current UNIX timestamp
$history = $today - ($days * 60 * 60 * 24); // Calculate the UNIX timestamp for the cutoff date

$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::COMPANY_TABLE_NAME);
$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::TABLE);

// Fetch the results as associative arrays
return $queryBuilder
->select('*')
->from(self::COMPANY_TABLE_NAME) // Your table name
->from(self::TABLE) // Your table name
->where(
$queryBuilder->expr()->lt('tstamp', $queryBuilder->createNamedParameter($history, ParameterType::INTEGER)),
)
Expand All @@ -184,11 +184,11 @@ public function findOlderThan(int $days): array

public function hideCompany(int $companyId): void
{
$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::COMPANY_TABLE_NAME);
$queryBuilder = $this->connectionPool->getQueryBuilderForTable(self::TABLE);

// Build and execute the update query
$queryBuilder
->update(self::COMPANY_TABLE_NAME)
->update(self::TABLE)
->set('hidden', 1)
->where(
$queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($companyId, ParameterType::INTEGER)),
Expand Down

0 comments on commit c22260b

Please sign in to comment.