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
<?php | |
use Cake\Core\Plugin; | |
use Cake\Utility\Inflector; | |
$tables = []; | |
$plugins = [ | |
'Queue', | |
'QueueScheduler', |
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
<?php | |
declare(strict_types=1); | |
namespace App\Http\Middleware; | |
use Cake\Core\Exception\CakeException; | |
use Cake\Core\InstanceConfigTrait; | |
use Cake\Http\Response; | |
use Cake\Log\Log; |
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
<?php | |
declare(strict_types=1); | |
namespace App\Command; | |
use Cake\Command\Command; | |
use Cake\Console\Arguments; | |
use Cake\Console\ConsoleIo; | |
use Cake\Console\ConsoleOptionParser; |
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
<?php | |
namespace App\Controller\Component; | |
use Cake\Controller\Component\PaginatorComponent as CorePaginatorComponent; | |
use Cake\Datasource\QueryInterface; | |
use Cake\Network\Exception\NotFoundException; | |
class PaginatorComponent extends CorePaginatorComponent | |
{ |
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
/** | |
* @param Event $event | |
* @param Query $query | |
* @return void | |
*/ | |
public function beforeFind(Event $event, Query $query) { | |
$this->encodeBitmaskConditions($query); | |
$field = $this->_config['field']; | |
if (!($mappedField = $this->_config['mappedField'])) { |
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
array( | |
(int) 0 => array( | |
'ParentCategory' => array( | |
'id' => '1', | |
'name' => 'Lorem ipsum dolor sit amet', | |
'parent_id' => '1' | |
) | |
) | |
) |
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
Overwrite completly: | |
public function setup(Model $Model, $config = array()) { | |
$this->settings[$Model->alias] = $config + $this->_defaultConfig; | |
} | |
Merge: | |
public function setup(Model $Model, $config = array()) { |
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
public function afterFind($results, $primary = false) { | |
if (!$primary && $this->attached('Translate')) { | |
$results = $Model->Behaviors->Translate->afterFind($this, $results, $primary); | |
} | |
... | |
} |