This file contains hidden or 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 SptSoftware\Statement\Model\Table; | |
use Cake\Database\Schema\TableSchema; | |
use Cake\ORM\RulesChecker; | |
use Cake\ORM\Table; | |
use Cake\Validation\Validator; | |
/** |
This file contains hidden or 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 Migrations\AbstractMigration; | |
class Initial extends AbstractMigration | |
{ | |
public function up() | |
{ | |
$table = $this->table('core_requests'); |
This file contains hidden or 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
.Exception: Referenced fixture class "InformationServices\Test\Fixture\BisnodeQueriesFixture" not found. | |
Fixture "plugin.information_services.bisnode_queries" was referenced in test | |
case "InformationServices\Test\TestCase\Model\Table\BisnodeQueriesTableTest". | |
in [D:\xampp\htdocs\api_app\vendor\cakephp\cakephp\src\TestSuite\Fixture\FixtureManager.php, line 213] |
This file contains hidden or 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->get('/'); | |
$this->assertResponseCode(404); | |
$res = json_decode($this->_response->body()); | |
$this->assertEquals($res->headers->response->code, 404); | |
$this->assertEquals($res->headers->response->errorMessage, 'Bad request!'); |
This file contains hidden or 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->controller->set('response', Response::instance()->toArray()); | |
$this->controller->set('_serialize', 'response'); | |
$this->controller->response->statusCode($this->_getCode()); | |
$this->controller->response->type('json'); | |
$this->controller->View = $this->controller->createView(); | |
$this->controller->response->body($this->controller->View->render('Core.Error/json_error', false)); | |
$this->controller->response->send(); |
This file contains hidden or 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->set('response', $responseArray); | |
$this->set('_serialize', 'response'); | |
$this->response->statusCode($code); | |
$this->response->type('json'); |
This file contains hidden or 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
$event = new Event( | |
'Log.Request.save', [ | |
'Request' => $this->_Request, | |
'data' => [ | |
'get' => $this->request->query, | |
'post' => $this->request->data, | |
'client_ip_address' => $this->request->clientIp(), | |
'uri' => $this->request->url, | |
], | |
] |
This file contains hidden or 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
class AppExceptionRenderer extends ExceptionRenderer | |
{ | |
public function render() | |
{ | |
$exception = $this->error; | |
$this->controller->set('response', ['foo' => 'bar']); | |
$this->controller->set('_serialize', 'response'); | |
$this->controller->response->statusCode($exception->getCode()); | |
$this->controller->response->type('json'); |
This file contains hidden or 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
people: | |
path: /people | |
config: PluginPeople.people_routes | |
cars: | |
path: / | |
config: | |
plugin: PluginCars | |
controller: Cars | |
action: index |
This file contains hidden or 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
$query->select(function ($exp) use ($query) { | |
$concatPerson = $query->func()->concat(['lastname' => 'literal', ', ', 'firstnames' => 'literal']); | |
return $exp->addCase( | |
[ | |
$query->newExpr()->eq('type', 1), | |
$query->newExpr()->eq('type', 2), | |
], | |
[$concatPerson, 'business_name'], | |
['string', 'string'] | |
); |
NewerOlder