refactor(plugin): rename Plan to Program and add audience/UTM routes
Rename the Plan bundle to Program across config, routes, menus, and controllers (Plan -> Initiative), bump version to 0.16.0, and introduce new audience and UTM taxonomy routes and permissions to support the expanded Programs feature set.
This commit is contained in:
1 parent
8268fad886
commit
71ff11390b
121 files changed
+5011
-2874
No files matched your search
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MauticPlugin\ProgramBundle\Entity;
|
||||
|
||||
use Mautic\CoreBundle\Entity\CommonRepository;
|
||||
|
||||
/**
|
||||
* @extends CommonRepository<Initiative>
|
||||
*/
|
||||
class InitiativeRepository extends CommonRepository
|
||||
{
|
||||
public function getTableAlias(): string
|
||||
{
|
||||
return 'p';
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the owner and category with the plans, so that the list doesn't query them one by one.
|
||||
*
|
||||
* @param array<string, mixed> $args
|
||||
*/
|
||||
public function getEntities(array $args = [])
|
||||
{
|
||||
$alias = $this->getTableAlias();
|
||||
|
||||
$args['qb'] = $this->createQueryBuilder($alias)
|
||||
->select($alias, 'o', 'c')
|
||||
->leftJoin($alias.'.owner', 'o')
|
||||
->leftJoin($alias.'.category', 'c');
|
||||
|
||||
return parent::getEntities($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* The list's search box matches the name.
|
||||
*
|
||||
* @return array<int, mixed>
|
||||
*/
|
||||
protected function addCatchAllWhereClause($q, $filter): array
|
||||
{
|
||||
return $this->addStandardCatchAllWhereClause($q, $filter, [
|
||||
$this->getTableAlias().'.name',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array{0: string, 1: string}>
|
||||
*/
|
||||
protected function getDefaultOrder(): array
|
||||
{
|
||||
return [
|
||||
[$this->getTableAlias().'.name', 'ASC'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user