for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class AreasAPI extends ProfilesAdminDataAPI
{
public function __construct()
parent::__construct('profiles', 'area', 'short_name');
'short_name'
string
boolean
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
}
public function setup($app)
parent::setup($app);
$app->get('/{name}/leads', array($this, 'getLeads'));
protected function canCreate($request)
$this->validateIsAdmin($request);
return true;
protected function canUpdate($request, $entity)
public function getLeads($request, $response, $args)
$this->validateLoggedIn($request);
$dataTable = DataSetFactory::getDataTableByNames('profiles', 'position');
$odata = $request->getAttribute('odata', new \ODataParams(array()));
$leads = $dataTable->read(new \Data\Filter("area eq '".$args['name']."'"), $odata->select, $odata->top,
$odata->skip, $odata->orderby);
if(empty($leads))
return $response->withStatus(404);
return $response->withJson($leads);
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: