YetiForceCompany/YetiForceCRM

View on GitHub
api/webservice/WebserviceStandard/BaseModule/Record.php

Summary

Maintainability
C
1 day
Test Coverage
B
89%

Function get has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $displayData = $fieldsLabel = [];
        $moduleName = $this->controller->request->get('module');
        $setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/Record.php - About 3 hrs to fix

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 checkPermission has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected function checkPermission(): void
    {
        parent::checkPermission();
        $moduleName = $this->controller->request->getModule();
        if ('POST' === $this->controller->method) {
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/Record.php - About 2 hrs to fix

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

Method get has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $displayData = $fieldsLabel = [];
        $moduleName = $this->controller->request->get('module');
        $setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);
Severity: Major
Found in api/webservice/WebserviceStandard/BaseModule/Record.php - About 2 hrs to fix

    Method checkPermission has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function checkPermission(): void
        {
            parent::checkPermission();
            $moduleName = $this->controller->request->getModule();
            if ('POST' === $this->controller->method) {
    Severity: Minor
    Found in api/webservice/WebserviceStandard/BaseModule/Record.php - About 1 hr to fix

      Function post has a Cognitive Complexity of 7 (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')) {
      Severity: Minor
      Found in api/webservice/WebserviceStandard/BaseModule/Record.php - About 35 mins to fix

      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

      The method get() has an NPath complexity of 1064. The configured NPath complexity threshold is 200.
      Open

          public function get(): array
          {
              $displayData = $fieldsLabel = [];
              $moduleName = $this->controller->request->get('module');
              $setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);

      NPathComplexity

      Since: 0.1

      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

      Example

      class Foo {
          function bar() {
              // lots of complicated code
          }
      }

      Source https://phpmd.org/rules/codesize.html#npathcomplexity

      The method checkPermission() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
      Open

          protected function checkPermission(): void
          {
              parent::checkPermission();
              $moduleName = $this->controller->request->getModule();
              if ('POST' === $this->controller->method) {

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

      The method get() has a Cyclomatic Complexity of 17. The configured cyclomatic complexity threshold is 10.
      Open

          public function get(): array
          {
              $displayData = $fieldsLabel = [];
              $moduleName = $this->controller->request->get('module');
              $setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

      Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.
      Open

          protected function checkPermission(): void

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Refactor this function to reduce its Cognitive Complexity from 26 to the 15 allowed.
      Open

          public function get(): array

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

      Missing class import via use statement (line '60', column '17').
      Open

                              throw new \Api\Core\Exception('No permissions to view record', 403);

      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 '329', column '20').
      Open

              $saveModel = new \Api\WebserviceStandard\Save();

      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('No permissions to create record', 403);

      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 '47', column '15').
      Open

                      throw new \Api\Core\Exception('Record doesn\'t exist', 404);

      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 '66', column '17').
      Open

                              throw new \Api\Core\Exception('No permissions to edit record', 403);

      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 '44', column '15').
      Open

                      throw new \Api\Core\Exception('No record id', 404);

      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 '54', column '17').
      Open

                              throw new \Api\Core\Exception('No permissions to remove record', 403);

      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 '\App\Record' in method 'checkPermission'.
      Open

                  if (!\App\Record::isExists($this->controller->request->getInteger('record'), $moduleName)) {

      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 '\Vtiger_Record_Model' in method 'checkPermission'.
      Open

                  $this->recordModel = \Vtiger_Record_Model::getInstanceById($this->controller->request->getInteger('record'), $moduleName);

      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\Fields\Currency' in method 'get'.
      Open

                          $summaryInventory[$name] = \App\Fields\Currency::formatToDisplay($field->getSummaryValuesFromData($rawInventory), null, true);

      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 '\Vtiger_Record_Model' in method 'checkPermission'.
      Open

                  $this->recordModel = \Vtiger_Record_Model::getCleanInstance($moduleName);

      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')) {
                      throw new \Api\Core\Exception('No record id', 404);
                  }
                  if (!\App\Record::isExists($this->controller->request->getInteger('record'), $moduleName)) {

      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 '\App\Language' in method 'get'.
      Open

                  $fieldsLabel[$fieldModel->getName()] = \App\Language::translate($fieldModel->get('label'), $moduleName);

      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\Json' in method 'get'.
      Open

              $fieldParams = \App\Json::decode($this->controller->request->getHeader('x-fields-params')) ?: [];

      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()),

      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 'put'.
      Open

              \Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);

      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\Log' in method 'checkPermission'.
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      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 assigning values to variables in if clauses and the like (line '208', column '56').
      Open

          public function get(): array
          {
              $displayData = $fieldsLabel = [];
              $moduleName = $this->controller->request->get('module');
              $setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);

      IfStatementAssignment

      Since: 2.7.0

      Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($foo = 'bar') { // possible typo
                  // ...
              }
              if ($baz = 0) { // always false
                  // ...
              }
          }
      }

      Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

      Avoid using static access to class '\Vtiger_Inventory_Model' in method 'get'.
      Open

                  $inventoryModel = \Vtiger_Inventory_Model::getInstance($moduleName);

      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\Log' in method 'checkPermission'.
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      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\Log' in method 'checkPermission'.
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      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 'get'.
      Open

              \Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);

      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')) {

      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 "Privilege::isPermittedLevel: " 3 times.
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      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.

      Argument 1 (value) is float|int but \App\Fields\Currency::formatToDisplay() takes string defined at /code/app/Fields/Currency.php:30
      Open

                          $summaryInventory[$name] = \App\Fields\Currency::formatToDisplay($field->getSummaryValuesFromData($rawInventory), null, true);

      Call to method error from undeclared class \App\Log
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      Call to method error from undeclared class \App\Log
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      Call to method error from undeclared class \App\Log
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      Possibly zero references to use statement for classlike/namespace OA (\OpenApi\Annotations)
      Open

      use OpenApi\Annotations as OA;

      Argument 1 (state) is 'Trash' but \Vtiger_Record_Model::changeState() takes \type defined at /code/modules/Vtiger/models/Record.php:1784
      Open

              $this->recordModel->changeState('Trash');

      Spaces must be used for alignment; tabs are not allowed
      Open

                          if (!$this->recordModel->isViewable()) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                          break;

      Spaces must be used for alignment; tabs are not allowed
      Open

                          }

      Spaces must be used for alignment; tabs are not allowed
      Open

                          break;

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc}  */

      Spaces must be used for alignment; tabs are not allowed
      Open

              } else {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Gets the details of a record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Data for the record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=403,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=404,

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Fields-Settings"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

       * @author    Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>

      Spaces must be used for alignment; tabs are not allowed
      Open

       * @author    Arkadiusz Adach <a.adach@yetiforce.com>

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc}  */

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if (!\App\Record::isExists($this->controller->request->getInteger('record'), $moduleName)) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                      case 'DELETE':

      Spaces must be used for alignment; tabs are not allowed
      Open

                          }

      Spaces must be used for alignment; tabs are not allowed
      Open

                      case 'PUT':

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return array

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Gets the details of a record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="x-parent-id", in="header", @OA\Schema(type="integer"), description="Parent record id", required=false, example=5),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200,

      Spaces must be used for alignment; tabs are not allowed
      Open

          public $allowedMethod = ['GET', 'DELETE', 'PUT', 'POST'];

      Spaces must be used for alignment; tabs are not allowed
      Open

                      throw new \Api\Core\Exception('No permissions to create record', 403);

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Fields-Settings"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Get_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

          public $recordModel;

      Spaces must be used for alignment; tabs are not allowed
      Open

                              throw new \Api\Core\Exception('No permissions to edit record', 403);

      Spaces must be used for alignment; tabs are not allowed
      Open

          }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** {@inheritdoc}  */

      Spaces must be used for alignment; tabs are not allowed
      Open

                      throw new \Api\Core\Exception('No record id', 404);

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Get record detail.

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Get_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

                          if (!$this->recordModel->privilegeToMoveToTrash()) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                          break;

      Spaces must be used for alignment; tabs are not allowed
      Open

                              throw new \Api\Core\Exception('No permissions to view record', 403);

      Spaces must be used for alignment; tabs are not allowed
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *         @OA\Parameter(name="x-fields-params", in="header", description="JSON array - list of fields to be returned in the specified way", required=false,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="`No permissions to remove record` OR `No permissions to view record` OR `No permissions to edit record`",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

       * @license    YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)

      Spaces must be used for alignment; tabs are not allowed
      Open

                  switch ($this->controller->method) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                          break;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

          public $allowedHeaders = ['x-parent-id', 'x-fields-params'];

      Spaces must be used for alignment; tabs are not allowed
      Open

          protected function checkPermission(): void

      Spaces must be used for alignment; tabs are not allowed
      Open

          {

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->recordModel = \Vtiger_Record_Model::getCleanInstance($moduleName);

      Spaces must be used for alignment; tabs are not allowed
      Open

                      case 'GET':

      Spaces must be used for alignment; tabs are not allowed
      Open

              }

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @api

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Get(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Get_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=403,

      Spaces must be used for alignment; tabs are not allowed
      Open

              $moduleName = $this->controller->request->getModule();

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="x-parent-id", in="header", @OA\Schema(type="integer"), description="Parent record id", required=false, example=5),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ('POST' === $this->controller->method) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                      throw new \Api\Core\Exception('Record doesn\'t exist', 404);

      Spaces must be used for alignment; tabs are not allowed
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="A list of custom parameters that can affect the return value of a given field.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

                      }

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if ($this->controller->request->isEmpty('record')) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                      default:

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Data for the record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if (!$this->recordModel->isCreateable()) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                          if (!$this->recordModel->isEditable()) {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        operationId="getRecord",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="Gets data for the record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

       * @author    Radosław Skrzypczak <r.skrzypczak@yetiforce.com>

      Spaces must be used for alignment; tabs are not allowed
      Open

          /** @var \Vtiger_Record_Model Record model instance. */

      Spaces must be used for alignment; tabs are not allowed
      Open

              parent::checkPermission();

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $this->recordModel = \Vtiger_Record_Model::getInstanceById($this->controller->request->getInteger('record'), $moduleName);

      Spaces must be used for alignment; tabs are not allowed
      Open

                              throw new \Api\Core\Exception('No permissions to remove record', 403);

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        operationId="getRecord",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Get_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="`No permissions to remove record` OR `No permissions to view record` OR `No permissions to edit record`",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Response body for Record",

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function get(): array

      Spaces must be used for alignment; tabs are not allowed
      Open

                              \App\Log::error('Privilege::isPermittedLevel: ' . \App\Privilege::$isPermittedLevel, 'API');

      Spaces must be used for alignment; tabs are not allowed
      Open

                          }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *         @OA\Parameter(name="x-fields-params", in="header", description="JSON array - list of fields to be returned in the specified way", required=false,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="Gets data for the record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Custom field settings",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Get_Record_Response",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                 type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                @OA\Property(property="isEditable", description="Check if record is editable", type="boolean", example=true),

      Spaces must be used for alignment; tabs are not allowed
      Open

              $displayData = $fieldsLabel = [];

      Spaces must be used for alignment; tabs are not allowed
      Open

              $fieldParams = \App\Json::decode($this->controller->request->getHeader('x-fields-params')) ?: [];

      Spaces must be used for alignment; tabs are not allowed
      Open

                      continue;

      Spaces must be used for alignment; tabs are not allowed
      Open

              }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="A list of custom parameters that can affect the return value of a given field.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required={"name", "id", "fields", "data"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                 @OA\AdditionalProperties(type="string", description="Field label"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                 type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="rawData", description="Raw record data", type="object", ref="#/components/schemas/Record_Raw_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $displayData[$fieldModel->getName()] = $uiTypeModel->getApiDisplayValue($value, $this->recordModel, $fieldParams[$fieldModel->getName()] ?? []);

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($this->recordModel->getModule()->isInventory()) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $inventoryModel = \Vtiger_Inventory_Model::getInstance($moduleName);

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $inventoryRow[$name] = $field->getDisplayValue($row[$name], $row, true);

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $response['rawInventory'] = $rawInventory;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Response body for Record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $fieldsLabel[$fieldModel->getName()] = \App\Language::translate($fieldModel->get('label'), $moduleName);

      Spaces must be used for alignment; tabs are not allowed
      Open

                  ],

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $inventoryRow = [];

      Spaces must be used for alignment; tabs are not allowed
      Open

                  foreach ($inventoryFields as $name => $field) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                      if ('id' === $key || 'record_module' === $key || (($fieldModel = $this->recordModel->getField($key)) && $fieldModel->isViewable())) {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Custom field settings",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *         example={"password" : {"showHiddenData" : true}}

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="data", title="Record data", type="object", ref="#/components/schemas/Record_Display_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

          {

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $inventory = $summaryInventory = [];

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=404,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            property="result",

      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", "assigned_user_id" : "Assigned user", "createdtime" : "Created time"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                 @OA\AdditionalProperties(type="string", description="Field label"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="inventory", description="Value inventory data", type="object"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="rawInventory", description="Inventory data", type="object"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $rawInventory = $this->recordModel->getInventoryData();

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $rawData = [];

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Get_Record_Response",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="id", description="Record Id", type="integer", example=152),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                title="Parameters determining checking of editing rights and moving to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

              \Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);

      Spaces must be used for alignment; tabs are not allowed
      Open

              }

      Spaces must be used for alignment; tabs are not allowed
      Open

                      $inventory[] = $inventoryRow;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            ),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'name' => \App\Purifier::decodeHtml($this->recordModel->getName()),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'fields' => $fieldsLabel,

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'data' => $displayData,

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $response['rawData'] = $rawData;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="`No record id` OR `Record doesn't exist`",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            title="Record data",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="inventory", description="Value inventory data", type="object"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="summaryInventory", description="Value summary inventory data", type="object"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="rawInventory", description="Inventory data", type="object"),

      Spaces must be used for alignment; tabs are not allowed
      Open

              ];

      Spaces must be used for alignment; tabs are not allowed
      Open

                      if ($field->isSummary()) {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Fields-Settings",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            type="object",

      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", "assigned_user_id" : "Assigned user", "createdtime" : "Created time"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="data", title="Record data", type="object", ref="#/components/schemas/Record_Display_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Fields-Settings",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required={"name", "id", "fields", "data"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                property="privileges",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                @OA\Property(property="isEditable", description="Check if record is editable", type="boolean", example=true),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if (!$fieldModel->isActiveField() || !$fieldModel->isViewable()) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $value = $this->recordModel->get($fieldModel->getName());

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $inventoryFields = $inventoryModel->getFields();

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $summaryInventory[$name] = \App\Fields\Currency::formatToDisplay($field->getSummaryValuesFromData($rawInventory), null, true);

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($setRawData) {

      Spaces must be used for alignment; tabs are not allowed
      Open

              $this->recordModel->changeState('Trash');

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Put(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Retrieves data for editing a record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Retrieves data for editing a record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\RequestBody(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Put_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="name", description="Record name", type="string", example="Driving school"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="id", description="Record Id", type="integer", example=152),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                 required={"isEditable", "moveToTrash"},

      Spaces must be used for alignment; tabs are not allowed
      Open

              $setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);

      Spaces must be used for alignment; tabs are not allowed
      Open

              foreach ($this->recordModel->getModule()->getFields() as $fieldModel) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'isEditable' => $this->recordModel->isEditable(),

      Spaces must be used for alignment; tabs are not allowed
      Open

                      'moveToTrash' => $this->recordModel->privilegeToDelete(),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  if ($setRawData) {

      Spaces must be used for alignment; tabs are not allowed
      Open

              }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Delete record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200,

      Spaces must be used for alignment; tabs are not allowed
      Open

          {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Record_Edit_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Put_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="`No record id` OR `Record doesn't exist`",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                 required={"isEditable", "moveToTrash"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $uiTypeModel = $fieldModel->getUITypeModel();

      Spaces must be used for alignment; tabs are not allowed
      Open

                  foreach ($rawInventory as $row) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $response['inventory'] = $inventory;

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $response['summaryInventory'] = $summaryInventory;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *         example={"password" : {"showHiddenData" : true}}

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            title="Record data",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="name", description="Record name", type="string", example="Driving school"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                property="privileges",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="summaryInventory", description="Value summary inventory data", type="object"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="rawData", description="Raw record data", type="object", ref="#/components/schemas/Record_Raw_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           */

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'privileges' => [

      Spaces must be used for alignment; tabs are not allowed
      Open

                      }

      Spaces must be used for alignment; tabs are not allowed
      Open

                      }

      Spaces must be used for alignment; tabs are not allowed
      Open

                  foreach ($this->recordModel->getData() as $key => $value) {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Delete_Record_Response"),

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

          }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="Contents of the request contains an associative array with the data record.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Delete record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function delete(): bool

      Spaces must be used for alignment; tabs are not allowed
      Open

              return true;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required=true,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Record_Edit_Details"),

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Link(link="GetRecordById", ref="#/components/links/GetRecordById")

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            property="result",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *                title="Parameters determining checking of editing rights and moving to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

              $moduleName = $this->controller->request->get('module');

      Spaces must be used for alignment; tabs are not allowed
      Open

              $response = [

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'id' => $this->recordModel->getId(),

      Spaces must be used for alignment; tabs are not allowed
      Open

                      foreach ($inventoryFields as $name => $field) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $rawData[$key] = $this->recordModel->getRawValue($key);

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Delete(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="List of records moved to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"),

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $response;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Put_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Contents of the response contains only id",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Delete_Record_Response",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(property="result", type="boolean", description="Status of successful transfer of the record to the recycle bin"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Edit record.

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Record_Edit_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Response body for Record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required={"id", "name"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Changes the state of a record, moving it to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Delete_Record_Response",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Transfer to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200, description="Contents of the response contains only id",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @api

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Edit record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

          }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Changes the state of a record, moving it to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return array

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Edit record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Put_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Contents of the response contains only id",

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="List of records moved to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Delete_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Transfer to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="Contents of the request contains an associative array with the data record.",

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=406, description="No input data",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Response body for Record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="List of records moved to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Delete_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Delete_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(property="result", type="boolean", description="Status of successful transfer of the record to the recycle bin"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           */

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200, description="Contents of the response contains only id",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=406, description="No input data",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Put_Record_Response",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required={"id", "name"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="id", type="integer", description="Id of the newly created record", example=22),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Delete record.

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @api

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Record_Edit_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Put_Record_Response",

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="id", type="integer", description="Id of the newly created record", example=22),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="List of records moved to the trash",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\RequestBody(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return bool

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required=true,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Link(link="GetRecordById", ref="#/components/links/GetRecordById")

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Post(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Post_Record_Response",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : "YetiForce Administrator", "createdtime" : "2014-09-24 20:51"},

      Spaces must be used for alignment; tabs are not allowed
      Open

          {

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @return array

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required=true,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Record_Edit_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=406, description="No input data",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @api

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required=true,

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Link(link="GetRecordById", ref="#/components/links/GetRecordById")

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Record_Edit_Details",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="General - Record edit details",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Record data in user format for edit view",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Record_Display_Details",

      Spaces must be used for alignment; tabs are not allowed
      Open

              ];

      Spaces must be used for alignment; tabs are not allowed
      Open

                  $return['skippedData'] = $saveModel->skippedData;

      Spaces must be used for alignment; tabs are not allowed
      Open

          /**

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200, description="Contents of the response contains only id",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="BaseModule_Post_Record_Response",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="General - Record raw details",

      Spaces must be used for alignment; tabs are not allowed
      Open

              $return = [

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Create new record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\RequestBody(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="General - Record edit details",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Record_Display_Details",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Create record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Post_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=406, description="No input data",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        example={"field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Record data in user format for preview",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * Create record.

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="Contents of the request contains an associative array with the data record.",

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Record data in the system format as stored in a database",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="General - Record display details",

      Spaces must be used for alignment; tabs are not allowed
      Open

          }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            description="Contents of the request contains an associative array with the data record.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Record_Edit_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.",

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Record data in the system format as stored in a database",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Record data in user format for preview",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Post_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Contents of the response contains only id",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="General - Record raw details",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\RequestBody(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/BaseModule_Post_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Created records",

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        example={"field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="General - Record display details",

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function put(): array

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Link(link="GetRecordById", ref="#/components/links/GetRecordById")

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\JsonContent(ref="#/components/schemas/Exception"),

      Spaces must be used for alignment; tabs are not allowed
      Open

              \Api\WebserviceStandard\Fields::loadWebserviceFields($this->recordModel->getModule(), $this);

      Spaces must be used for alignment; tabs are not allowed
      Open

              $saveModel->init($this);

      Spaces must be used for alignment; tabs are not allowed
      Open

              }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        summary="Create record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        security={{"basicAuth" : {}, "ApiKeyAuth" : {}, "token" : {}}},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Record_Edit_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      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),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        title="Base module - Created records",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required={"id", "name"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            required={"id", "name"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="id", type="integer", description="Id of the newly created record", example=22),

      Spaces must be used for alignment; tabs are not allowed
      Open

           * @OA\Schema(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : "YetiForce Administrator", "createdtime" : "2014-09-24 20:51"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           */

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'name' => $this->recordModel->getName(),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="id", type="integer", description="Id of the newly created record", example=22),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/BaseModule_Post_Record_Response"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        required={"status", "result"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Record_Raw_Details",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        type="object",

      Spaces must be used for alignment; tabs are not allowed
      Open

              $saveModel = new \Api\WebserviceStandard\Save();

      Spaces must be used for alignment; tabs are not allowed
      Open

              if ($saveModel->skippedData) {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        path="/webservice/WebserviceStandard/{moduleName}/Record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            @OA\XmlContent(ref="#/components/schemas/Record_Edit_Details"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Contents of the response contains only id",

      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"),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Record_Edit_Details",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Record data in user format for edit view",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        schema="Record_Raw_Details",

      Spaces must be used for alignment; tabs are not allowed
      Open

              $saveModel->saveRecord($this->controller->request);

      Spaces must be used for alignment; tabs are not allowed
      Open

                  'id' => $this->recordModel->getId(),

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $return;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="Create new record",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        tags={"BaseModule"},

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            response=200, description="Contents of the response contains only id",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Response(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *    @OA\Link(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        operationId="getRecord",

      Spaces must be used for alignment; tabs are not allowed
      Open

                          $this->recordModel->set($fieldName, 1);

      Spaces must be used for alignment; tabs are not allowed
      Open

          }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        link="GetRecordById",

      Spaces must be used for alignment; tabs are not allowed
      Open

          {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            "recordId" = "$response.body#/result/id"

      Spaces must be used for alignment; tabs are not allowed
      Open

                  }

      Spaces must be used for alignment; tabs are not allowed
      Open

                  foreach ($this->recordModel->getModule()->getFieldsByType('serverAccess') as $fieldName => $fieldModel) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                      }

      Spaces must be used for alignment; tabs are not allowed
      Open

              return $this->put();

      Spaces must be used for alignment; tabs are not allowed
      Open

                          break;

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        ),

      Spaces must be used for alignment; tabs are not allowed
      Open

           *    @OA\Link(

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        operationId="getRecord",

      Spaces must be used for alignment; tabs are not allowed
      Open

              }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        parameters={

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        }

      Spaces must be used for alignment; tabs are not allowed
      Open

           */

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="The `id` value returned in the response can be used as the `recordId` parameter in `GET /webservice/{moduleName}/Record/{recordId}`.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           * ),

      Spaces must be used for alignment; tabs are not allowed
      Open

              if (1 !== $this->getUserData('type')) {

      Spaces must be used for alignment; tabs are not allowed
      Open

                      if ($fieldModel->getFieldParams() == $this->getUserData('server_id')) {

      Spaces must be used for alignment; tabs are not allowed
      Open

           *            "recordId" = "$response.body#/result/id"

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        }

      Spaces must be used for alignment; tabs are not allowed
      Open

           *    )

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        description="The `id` value returned in the response can be used as the `recordId` parameter in `GET /webservice/{moduleName}/Record/{recordId}`.",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        parameters={

      Spaces must be used for alignment; tabs are not allowed
      Open

           *        link="GetRecordById",

      Spaces must be used for alignment; tabs are not allowed
      Open

           *    )

      Spaces must be used for alignment; tabs are not allowed
      Open

          public function post(): array

      Line exceeds 120 characters; contains 135 characters
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Line exceeds 120 characters; contains 134 characters
      Open

           *            description="`No permissions to remove record` OR `No permissions to view record` OR `No permissions to edit record`",

      Line exceeds 120 characters; contains 134 characters
      Open

                  $this->recordModel = \Vtiger_Record_Model::getInstanceById($this->controller->request->getInteger('record'), $moduleName);

      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),

      Line exceeds 120 characters; contains 157 characters
      Open

           *         @OA\Parameter(name="x-fields-params", in="header", description="JSON array - list of fields to be returned in the specified way", required=false,

      Line exceeds 120 characters; contains 131 characters
      Open

           *        @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

      Line exceeds 120 characters; contains 145 characters
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Line exceeds 120 characters; contains 146 characters
      Open

           *        @OA\Parameter(name="x-parent-id", in="header", @OA\Schema(type="integer"), description="Parent record id", required=false, example=5),

      Line exceeds 120 characters; contains 156 characters
      Open

                  $displayData[$fieldModel->getName()] = $uiTypeModel->getApiDisplayValue($value, $this->recordModel, $fieldParams[$fieldModel->getName()] ?? []);

      Line exceeds 120 characters; contains 124 characters
      Open

           *                @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false),

      Line exceeds 120 characters; contains 149 characters
      Open

                      if ('id' === $key || 'record_module' === $key || (($fieldModel = $this->recordModel->getField($key)) && $fieldModel->isViewable())) {

      Line exceeds 120 characters; contains 133 characters
      Open

           *            @OA\Property(property="data", title="Record data", type="object", ref="#/components/schemas/Record_Display_Details"),

      Line exceeds 120 characters; contains 142 characters
      Open

           *            @OA\Property(property="rawData", description="Raw record data", type="object", ref="#/components/schemas/Record_Raw_Details"),

      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"),

      Line exceeds 120 characters; contains 131 characters
      Open

           *        @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

      Line exceeds 120 characters; contains 129 characters
      Open

           *                @OA\Property(property="isEditable", description="Check if record is editable", type="boolean", example=true),

      Line exceeds 120 characters; contains 138 characters
      Open

           *        @OA\Property(property="result", type="boolean", description="Status of successful transfer of the record to the recycle bin"),

      Line exceeds 120 characters; contains 146 characters
      Open

                          $summaryInventory[$name] = \App\Fields\Currency::formatToDisplay($field->getSummaryValuesFromData($rawInventory), null, true);

      Line exceeds 120 characters; contains 255 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", "assigned_user_id" : "Assigned user", "createdtime" : "Created time"},

      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"),

      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"),

      Line exceeds 120 characters; contains 145 characters
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Line exceeds 120 characters; contains 122 characters
      Open

           *        @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.",

      Line exceeds 120 characters; contains 135 characters
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Line exceeds 120 characters; contains 145 characters
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Line exceeds 120 characters; contains 135 characters
      Open

           *        @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116),

      Line exceeds 120 characters; contains 131 characters
      Open

           *        @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

      Line exceeds 120 characters; contains 133 characters
      Open

           *            @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"),

      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"),

      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"),

      Line exceeds 120 characters; contains 169 characters
      Open

           *        example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : "YetiForce Administrator", "createdtime" : "2014-09-24 20:51"},

      Line exceeds 120 characters; contains 137 characters
      Open

           *        example={"field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"},

      Line exceeds 120 characters; contains 145 characters
      Open

           *        @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"),

      Line exceeds 120 characters; contains 131 characters
      Open

           *        @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true),

      Line exceeds 120 characters; contains 122 characters
      Open

           *        @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.",

      Line exceeds 120 characters; contains 133 characters
      Open

           *            @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"),

      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"),

      Line exceeds 120 characters; contains 148 characters
      Open

           *        example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"},

      Line exceeds 120 characters; contains 159 characters
      Open

           *        description="The `id` value returned in the response can be used as the `recordId` parameter in `GET /webservice/{moduleName}/Record/{recordId}`.",

      There are no issues that match your filters.

      Category
      Status