Method get
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function get(): array
{
$rawData = $this->recordModel->getData();
$displayData = $fieldsLabel = [];
foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {
Function checkPermission
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function checkPermission(): void
{
parent::checkPermission();
$moduleName = $this->controller->request->getModule();
if ('POST' === $this->controller->method) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function post
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function post(): array
{
if (1 !== $this->getUserData('type')) {
foreach ($this->recordModel->getModule()->getFieldsByType('serverAccess') as $fieldName => $fieldModel) {
if ($fieldModel->getFieldParams() == $this->getUserData('server_id')) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get(): array
{
$rawData = $this->recordModel->getData();
$displayData = $fieldsLabel = [];
foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Missing class import via use statement (line '36', column '15'). Open
throw new \Api\Core\Exception('No permissions to create user', 403);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '40', column '15'). Open
throw new \Api\Core\Exception('User doesn\'t exist', 404);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '227', column '20'). Open
$saveModel = new \Api\WebserviceStandard\Save();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '43', column '15'). Open
throw new \Api\Core\Exception('Access denied, access for administrators only', 403);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\Users_Record_Model' in method 'checkPermission'. Open
$this->recordModel = \Users_Record_Model::getCleanInstance($moduleName);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Api\WebserviceStandard\Fields' in method 'post'. Open
\Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\User' in method 'checkPermission'. Open
if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'get'. Open
$fieldsLabel[$fieldModel->getName()] = \App\Language::translate($fieldModel->get('label'), 'Users');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Users_Record_Model' in method 'checkPermission'. Open
$this->recordModel = \Users_Record_Model::getInstanceById($this->controller->request->getInteger('record'), 'Users');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Purifier' in method 'get'. Open
'name' => \App\Purifier::decodeHtml($this->recordModel->getName()),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method checkPermission uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {
throw new \Api\Core\Exception('User doesn\'t exist', 404);
}
if (!\App\User::getCurrentUserModel()->isAdmin()) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\Vtiger_Taxes_UIType' in method 'get'. Open
$rawData[$fieldModel->getName() . '_info'] = \Vtiger_Taxes_UIType::getValues($rawData[$fieldModel->getName()]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "record" 3 times. Open
if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "accesskey" 3 times. Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "user_password" 3 times. Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "confirm_password" 3 times. Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Possibly zero references to use statement for classlike/namespace OA
(\OpenApi\Annotations)
Open
use OpenApi\Annotations as OA;
- Exclude checks
Call to method isExists
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {
- Exclude checks
Argument 2 (value)
is 1
but \Users_Record_Model::set()
takes string
defined at /code/modules/Users/models/Record.php:52
Open
$this->recordModel->set($fieldName, 1);
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (!\App\User::getCurrentUserModel()->isAdmin()) {
- Exclude checks
Call to undeclared method \Vtiger_Base_UIType::getReferenceModule
Open
$referenceModule = $uiTypeModel->getReferenceModule($value);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @author Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ('POST' === $this->controller->method) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
parent::checkPermission();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public $recordModel;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** @var \Users_Record_Model User record model. */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
protected function checkPermission(): void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$moduleName = $this->controller->request->getModule();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @api
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* name="userId",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Users_Get_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="Users module - Response body for user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* in="path",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Users_Get_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Access denied, access for administrators only",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* property="result",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Parameters determining checking of editing rights and moving to the trash",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \Api\Core\Exception('User doesn\'t exist', 404);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* operationId="getUser",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="Users_Get_Record_Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="fields", type="object", title="System field names and field labels", example={"field_name_1" : "Field label 1", "field_name_2" : "Field label 2"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (!$this->recordModel->isCreateable()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \Api\Core\Exception('No permissions to create user', 403);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (!\App\User::getCurrentUserModel()->isAdmin()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Data for the user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required=true
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Users_Get_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=404,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="id", description="User Id", type="integer", example=1),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="fields", type="object", title="System field names and field labels", example={"field_name_1" : "Field label 1", "field_name_2" : "Field label 2"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="isEditable", description="Check if user is editable", type="boolean", example=true),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="rawData", description="Raw user data", type="object"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \Api\Core\Exception('Access denied, access for administrators only', 403);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(name="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Gets details about the user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example=116,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Gets data for the user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="id", description="User Id", type="integer", example=1),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public $allowedMethod = ['GET', 'POST'];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Get(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(type="integer"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Users_Get_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="name", description="User label", type="string", example="System Admin"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\AdditionalProperties(type="string", description="Field label"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* property="data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->recordModel = \Users_Record_Model::getCleanInstance($moduleName);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* operationId="getUser",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Gets data for the user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Gets details about the user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Get user detail.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"Users"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=403,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Access denied, access for administrators only",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* name="userId",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User id",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Parameters determining checking of editing rights and moving to the trash",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(type="integer"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User doesn't exist",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="Users_Get_Record_Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="Users module - Response body for user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\AdditionalProperties(type="string", description="Field label"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* property="data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* property="privileges",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Data for the user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required=true
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=404,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"Users"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* in="path",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example=116,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(name="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* property="result",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User doesn't exist",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="name", description="User label", type="string", example="System Admin"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/WebserviceStandard/Users/Record/{userId}",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User id",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* property="privileges",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="rawData", description="Raw user data", type="object"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->recordModel = \Users_Record_Model::getInstanceById($this->controller->request->getInteger('record'), 'Users');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/WebserviceStandard/Users/Record/{userId}",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=403,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="isEditable", description="Check if user is editable", type="boolean", example=true),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"status", "result"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User data in user format for create view",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Link(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($fieldModel->isReferenceField()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Link(link="GetUserById", ref="#/components/links/GetUserById")
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="id", type="integer", description="Id of the newly created user", example=22),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Link(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$rawData[$fieldModel->getName() . '_info'] = \Vtiger_Taxes_UIType::getValues($rawData[$fieldModel->getName()]);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Create user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"Users"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/User_Create_Details"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="User - Created user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="The `id` value returned in the response can be used as the `userId` parameter in `GET /webservice/Users/Record/{userId}`.",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$rawData = $this->recordModel->getData();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$value = $this->recordModel->get($fieldModel->getName());
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $response;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/User_Create_Details"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="User - Created user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Contents of the response contains only id and name",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="name", type="string", description="Id of the newly created user", example="YetiForce Name"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example={"user_name" : "tom", "first_name" : "Tom", "last_name" : "Kowalski", "roleid" : "H38", "password" : "MyFunP@ssword", "confirm_password" : "MyFunP@ssword", "email1" : "my@email.com", "language" : "en-US"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'data' => $displayData,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response['rawData'] = $rawData;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Create new user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$uiTypeModel = $fieldModel->getUITypeModel();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'name' => \App\Purifier::decodeHtml($this->recordModel->getName()),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @api
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="result", type="object", title="User data", description="Created user id and name.",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$displayData[$fieldModel->getName()] = $uiTypeModel->getApiDisplayValue($value, $this->recordModel);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'fields' => $fieldsLabel,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'isEditable' => false,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Post(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="General - User create details",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ('taxes' === $fieldModel->getFieldDataType()) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'id' => $this->recordModel->getId(),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Create new user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\RequestBody(required=true, description="Contents of the request contains an associative array with the user data.",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/User_Create_Details"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/User_Create_Details"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/User_Post_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=406, description="No input data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="User_Post_Record_Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="result", type="object", title="User data", description="Created user id and name.",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"id", "name"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'moveToTrash' => false,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/WebserviceStandard/Users/Record",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* summary="Create user",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/Exception"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$fieldsLabel[$fieldModel->getName()] = \App\Language::translate($fieldModel->get('label'), 'Users');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* path="/webservice/WebserviceStandard/Users/Record",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\RequestBody(required=true, description="Contents of the request contains an associative array with the user data.",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=406, description="No input data",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"status", "result"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'privileges' => [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="name", type="string", description="Id of the newly created user", example="YetiForce Name"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="User data in user format for create view",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* link="GetUserById",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function get(): array
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Response(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="User_Create_Details",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* example={"user_name" : "tom", "first_name" : "Tom", "last_name" : "Kowalski", "roleid" : "H38", "password" : "MyFunP@ssword", "confirm_password" : "MyFunP@ssword", "email1" : "my@email.com", "language" : "en-US"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="The `id` value returned in the response can be used as the `userId` parameter in `GET /webservice/Users/Record/{userId}`.",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($saveModel->skippedData) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$displayData = $fieldsLabel = [];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Create record.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200, description="Contents of the response contains only id",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="User_Post_Record_Response",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* schema="User_Create_Details",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="General - User create details",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->recordModel->set($fieldName, 1);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'id' => $this->recordModel->getId(),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$return['skippedData'] = $saveModel->skippedData;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$rawData[$fieldModel->getName() . '_module'] = $referenceModule ? $referenceModule->getName() : null;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
],
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\JsonContent(ref="#/components/schemas/User_Post_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* type="object",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* parameters={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* }
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($fieldModel->getFieldParams() == $this->getUserData('server_id')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$saveModel->init($this);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$referenceModule = $uiTypeModel->getReferenceModule($value);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Link(link="GetUserById", ref="#/components/links/GetUserById")
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Schema(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* required={"id", "name"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
foreach ($this->recordModel->getModule()->getFieldsByType('serverAccess') as $fieldName => $fieldModel) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $return;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (1 === (int) $this->controller->headers['x-raw-data'] ?? 0) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* tags={"Users"},
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* response=200, description="Contents of the response contains only id",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/User_Post_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\XmlContent(ref="#/components/schemas/User_Post_Record_Response"),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Contents of the response contains only id and name",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Property(property="id", type="integer", description="Id of the newly created user", example=22),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* link="GetUserById",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "recordId" = "$response.body#/result/id"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* parameters={
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function post(): array
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$saveModel = new \Api\WebserviceStandard\Save();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (1 !== $this->getUserData('type')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
\Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$return = [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* "recordId" = "$response.body#/result/id"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* )
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* operationId="getUser",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* }
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$saveModel->saveRecord($this->controller->request);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'name' => $this->recordModel->getName(),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* operationId="getUser",
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$this->recordModel = \Users_Record_Model::getInstanceById($this->controller->request->getInteger('record'), 'Users');
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
* @OA\Property(property="isEditable", description="Check if user is editable", type="boolean", example=true),
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
if ($this->controller->request->isEmpty('record', true) || !\App\User::isExists($this->controller->request->getInteger('record'), false)) {
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
* @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),
- Exclude checks
Line exceeds 120 characters; contains 185 characters Open
* @OA\Property(property="fields", type="object", title="System field names and field labels", example={"field_name_1" : "Field label 1", "field_name_2" : "Field label 2"},
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
* @OA\Parameter(name="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1),
- Exclude checks
Line exceeds 120 characters; contains 189 characters Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
* @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
$rawData[$fieldModel->getName() . '_info'] = \Vtiger_Taxes_UIType::getValues($rawData[$fieldModel->getName()]);
- Exclude checks
Line exceeds 120 characters; contains 163 characters Open
* @OA\Property(property="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"),
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
* @OA\RequestBody(required=true, description="Contents of the request contains an associative array with the user data.",
- Exclude checks
Line exceeds 120 characters; contains 270 characters Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
* @OA\Property(property="name", type="string", description="Id of the newly created user", example="YetiForce Name"),
- Exclude checks
Line exceeds 120 characters; contains 189 characters Open
* @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"),
- Exclude checks
Line exceeds 120 characters; contains 225 characters Open
* example={"user_name" : "tom", "first_name" : "Tom", "last_name" : "Kowalski", "roleid" : "H38", "password" : "MyFunP@ssword", "confirm_password" : "MyFunP@ssword", "email1" : "my@email.com", "language" : "en-US"},
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
* @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),
- Exclude checks
Line exceeds 120 characters; contains 148 characters Open
* description="The `id` value returned in the response can be used as the `userId` parameter in `GET /webservice/Users/Record/{userId}`.",
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks
No space found after comma in function call Open
unset($fieldsLabel['user_password'],$fieldsLabel['confirm_password'],$fieldsLabel['accesskey'],$displayData['user_password'],$displayData['confirm_password'],$displayData['accesskey'],$rawData['user_password'],$rawData['confirm_password'],$rawData['accesskey']);
- Exclude checks