aimeos /
ai-fosuser
| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
||
| 5 | * @copyright Aimeos (aimeos.org), 2014-2025 |
||
| 6 | */ |
||
| 7 | |||
| 8 | |||
| 9 | namespace Aimeos\Upscheme\Task; |
||
| 10 | |||
| 11 | |||
| 12 | /** |
||
| 13 | * Adds FOS user customer test data. |
||
| 14 | */ |
||
| 15 | class CustomerAddFosUserTestData extends CustomerAddTestData |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Returns the list of task names which this task depends on |
||
| 19 | * |
||
| 20 | * @return string[] List of task names |
||
| 21 | */ |
||
| 22 | public function after() : array |
||
| 23 | { |
||
| 24 | return ['Customer', 'Text', 'GroupAddTestData', 'ProductAddTestData']; |
||
| 25 | } |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * Adds customer test data |
||
| 30 | */ |
||
| 31 | public function up() |
||
| 32 | { |
||
| 33 | $this->info( 'Adding FosUser customer test data', 'vv' ); |
||
| 34 | |||
| 35 | $this->db( 'db-customer' )->exec( "DELETE FROM fos_user WHERE email LIKE 'test%@example.com'" ); |
||
| 36 | |||
| 37 | $this->context()->setEditor( 'ai-fosuser' ); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 38 | $this->process(); |
||
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | /** |
||
| 43 | * Returns the manager for the current setup task |
||
| 44 | * |
||
| 45 | * @param string $domain Domain name of the manager |
||
| 46 | * @param string $name Specific manager implemenation |
||
| 47 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
||
| 48 | */ |
||
| 49 | protected function getManager( string $domain, string $name = 'Standard' ) : \Aimeos\MShop\Common\Manager\Iface |
||
| 50 | { |
||
| 51 | if( $domain === 'customer' ) { |
||
| 52 | return parent::getManager( $domain, 'FosUser' ); |
||
| 53 | } |
||
| 54 | |||
| 55 | return parent::getManager( $domain ); |
||
| 56 | } |
||
| 57 | } |
||
| 58 |