-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extension to detect return type of LocatorAwareTrait::fetchTable
- Loading branch information
1 parent
ab8fb5a
commit 09e8f53
Showing
5 changed files
with
133 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright 2020, Cake Development Corporation (https://www.cakedc.com) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2020, Cake Development Corporation (https://www.cakedc.com) | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
|
||
namespace App\Model\Logic\Action; | ||
|
||
/** | ||
* Class DeleteUsers | ||
* | ||
* @package App\Model\Logic\Action | ||
*/ | ||
class BlockUsers extends WarnUsers | ||
{ | ||
/** | ||
* This object's default table alias. | ||
* | ||
* @var string|null | ||
*/ | ||
protected ?string $defaultTable = 'Users'; | ||
|
||
/** | ||
* @throws \Exception | ||
* @return void | ||
*/ | ||
public function process() | ||
{ | ||
parent::process(); | ||
|
||
$this->fetchTable()->blockOld(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright 2020, Cake Development Corporation (https://www.cakedc.com) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2020, Cake Development Corporation (https://www.cakedc.com) | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
|
||
namespace App\Model\Logic\Action; | ||
|
||
use Cake\ORM\Locator\LocatorAwareTrait; | ||
|
||
/** | ||
* Class DeleteUsers | ||
* | ||
* @package App\Model\Logic\Action | ||
*/ | ||
class WarnUsers | ||
{ | ||
use LocatorAwareTrait; | ||
|
||
/** | ||
* @throws \Exception | ||
* @return void | ||
*/ | ||
public function process() | ||
{ | ||
$this->fetchTable('Notes') | ||
->warning(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters