Add with parameter in Contact object to retrieve contact fields (#1044)
This commit is contained in:
@@ -28,6 +28,11 @@ class ApiController extends Controller
|
||||
*/
|
||||
protected $sort = 'created_at';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $withParameter = null;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@@ -59,6 +64,10 @@ class ApiController extends Controller
|
||||
$this->setLimitPerPage($request->get('limit'));
|
||||
}
|
||||
|
||||
if ($request->has('with')) {
|
||||
$this->setWithParameter($request->get('with'));
|
||||
}
|
||||
|
||||
// make sure the JSON is well formatted if the given call sends a JSON
|
||||
// TODO: there is probably a much better way to do that
|
||||
if ($request->method() != 'GET' && $request->method() != 'DELETE'
|
||||
@@ -104,6 +113,25 @@ class ApiController extends Controller
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getWithParameter()
|
||||
{
|
||||
return $this->withParameter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $with
|
||||
* @return $this
|
||||
*/
|
||||
public function setWithParameter($with)
|
||||
{
|
||||
$this->withParameter = $with;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user