YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/MeetingServices/models/Record.php

Summary

Maintainability
A
45 mins
Test Coverage
F
0%

Avoid using static access to class '\Vtiger_Field_Model' in method 'getFieldInstanceByName'.
Open

        return \Vtiger_Field_Model::init($moduleName, $params, $name);

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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $result = $db->createCommand()->insert($tableName, $params)->execute();
            $this->set('id', $db->getLastInsertID("{$tableName}_id_seq"));
        }

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\Purifier' in method 'getDisplayValue'.
Open

                $value = \App\Purifier::encodeHtml($value);

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

    public static function getInstanceById(int $id)
    {
        $instance = false;

        if ($row = \App\MeetingService::getService($id)) {

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_Link_Model' in method 'getRecordLinks'.
Open

            $links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);

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\MeetingService' in method 'getInstanceById'.
Open

        if ($row = \App\MeetingService::getService($id)) {

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\App\Language' in method 'getDisplayValue'.
Open

                $value = \App\Language::translate(1 == $value ? 'LBL_ACTIVE' : 'LBL_INACTIVE', $this->getModule()->getName(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 'App\Db' in method 'save'.
Open

        $db = App\Db::getInstance();

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\Cache' in method 'save'.
Open

        \App\Cache::delete('MeetingService::getServices', '');

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 'Settings_Vtiger_Module_Model' in method 'getModule'.
Open

            $this->module = Settings_Vtiger_Module_Model::getInstance('Settings:MeetingServices');

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 "secret" 4 times.
Open

            $row['secret'] = \App\Encryption::getInstance()->decrypt($row['secret']);

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 "maximumlength" 3 times.
Open

            'maximumlength' => $fields[$name]['maximumlength'] ?? '',

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 "status" 4 times.
Open

        if ($result && !empty($params['status'])) {

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.

Add a "case default" clause to this "switch" statement.
Open

        switch ($name) {

The requirement for a final case default clause is defensive programming. The clause should either take appropriate action, or contain a suitable comment as to why no action is taken. Even when the switch covers all current values of an enum, a default case should still be used because there is no guarantee that the enum won't be extended.

Noncompliant Code Example

switch ($param) {  //missing default clause
  case 0:
    do_something();
    break;
  case 1:
    do_something_else();
    break;
}

switch ($param) {
  default: // default clause should be the last one
    error();
    break;
  case 0:
    do_something();
    break;
  case 1:
    do_something_else();
    break;
}

Compliant Solution

switch ($param) {
  case 0:
    do_something();
    break;
  case 1:
    do_something_else();
    break;
  default:
    error();
    break;
}

See

  • MISRA C:2004, 15.0 - The MISRA C switch syntax shall be used.
  • MISRA C:2004, 15.3 - The final clause of a switch statement shall be the default clause
  • MISRA C++:2008, 6-4-3 - A switch statement shall be a well-formed switch statement.
  • MISRA C++:2008, 6-4-6 - The final clause of a switch statement shall be the default-clause
  • MISRA C:2012, 16.1 - All switch statements shall be well-formed
  • MISRA C:2012, 16.4 - Every switch statement shall have a default label
  • MISRA C:2012, 16.5 - A default label shall appear as either the first or the last switch label of a switch statement
  • MITRE, CWE-478 - Missing Default Case in Switch Statement
  • CERT, MSC01-C. - Strive for logical completeness
  • CERT, MSC01-CPP. - Strive for logical completeness

Saw an @param annotation for type, but the param list of function getCleanInstance() : \Settings_MeetingServices_Record_Model|\self is empty
Open

     * @param string $type

Return type of getCleanInstance() is undeclared type \self
Open

    public static function getCleanInstance()

Call to undeclared method \App\Db::createCommand
Open

            $result = $db->createCommand()->update($tableName, $params, ['id' => $this->getId()])->execute();

Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
Open

            $row['secret'] = \App\Encryption::getInstance()->decrypt($row['secret']);

Return type of getInstanceById() is undeclared type \self
Open

    public static function getInstanceById(int $id)

Call to undeclared method \Settings_Vtiger_Module_Model::getFormFields
Open

        $params = array_intersect_key($this->getData(), $this->getModule()->getFormFields());

Call to undeclared method \App\Db::createCommand
Open

            $db->createCommand()->update($tableName, ['status' => 0], ['<>', 'id', $this->getId()])->execute();

Call to undeclared method \App\Db::createCommand
Open

            $result = $db->createCommand()->insert($tableName, $params)->execute();

Reference to undeclared property \Settings_MeetingServices_Record_Model->module
Open

            $this->module = Settings_Vtiger_Module_Model::getInstance('Settings:MeetingServices');

Reference to undeclared property \Settings_MeetingServices_Record_Model->module
Open

        if (!isset($this->module)) {

Call to undeclared method \App\Db::createCommand
Open

        return \App\Db::getInstance()->createCommand()

Call to undeclared method \Settings_Vtiger_Module_Model::getFormFields
Open

        $fields = $this->getModule()->getFormFields();

Call to undeclared method \Settings_Vtiger_Module_Model::getFormFields
Open

        foreach ($this->getModule()->getFormFields() as $fieldName => $fieldInfo) {

Reference to undeclared property \Settings_MeetingServices_Record_Model->module
Open

        return $this->module;

Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
Open

        $params['secret'] = \App\Encryption::getInstance()->encrypt($params['secret']);

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        foreach ($this->getModule()->getFormFields() as $fieldName => $fieldInfo) {
            if ($request->has($fieldName)) {
                $value = $request->getByType($fieldName, $fieldInfo['purifyType']);
Severity: Minor
Found in modules/Settings/MeetingServices/models/Record.php and 1 other location - About 45 mins to fix
app/Controller/Traits/RecordSettings.php on lines 87..97

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 95.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Settings_MeetingServices_Record_Model extends Settings_Vtiger_Record_Model

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = App\Db::getInstance();

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The class Settings_MeetingServices_Record_Model is not named in CamelCase.
Open

class Settings_MeetingServices_Record_Model extends Settings_Vtiger_Record_Model
{
    /**
     * Length key.
     */

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    public static function getInstanceById(int $id)

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            ->delete($this->getModule()->baseTable, ['id' => $this->getId()])

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \self

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance->getModule();

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string URL

Spaces must be used to indent lines; tabs are not allowed
Open

        return $links;

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance = false;

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->set('id', $db->getLastInsertID("{$tableName}_id_seq"));

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        return \App\Db::getInstance()->createCommand()

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \self instance, if exists

Spaces must be used to indent lines; tabs are not allowed
Open

        $params['secret'] = \App\Encryption::getInstance()->encrypt($params['secret']);

Spaces must be used to indent lines; tabs are not allowed
Open

            $result = $db->createCommand()->update($tableName, $params, ['id' => $this->getId()])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

                'linklabel' => 'BTN_RECORD_EDIT',

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get the instance of record model.

Spaces must be used to indent lines; tabs are not allowed
Open

        return $instance;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getCleanInstance()

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($this->getId()) {

Spaces must be used to indent lines; tabs are not allowed
Open

        return (bool) $result;

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

                'linkdata' => ['url' => $this->getEditViewUrl()],

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    public function save()

Spaces must be used to indent lines; tabs are not allowed
Open

        $params = array_intersect_key($this->getData(), $this->getModule()->getFormFields());

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getId()

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->get('id');

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getRecordLinks(): array

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordLinks = [

Spaces must be used to indent lines; tabs are not allowed
Open

            $row['secret'] = \App\Encryption::getInstance()->decrypt($row['secret']);

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->module;

Spaces must be used to indent lines; tabs are not allowed
Open

        ];

Spaces must be used to indent lines; tabs are not allowed
Open

                break;

Line exceeds 120 characters; contains 130 characters
Open

                $value = \App\Language::translate(1 == $value ? 'LBL_ACTIVE' : 'LBL_INACTIVE', $this->getModule()->getName(true));

Spaces must be used to indent lines; tabs are not allowed
Open

            default:

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

            [

Spaces must be used to indent lines; tabs are not allowed
Open

                'linktype' => 'LISTVIEWRECORD',

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($recordLinks as $recordLink) {

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to delete the current record model.

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Length key.

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

                'linkclass' => 'btn btn-sm btn-primary js-edit-record-modal',

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($request->has($fieldName)) {

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getModule()

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Gets field instance by name.

Spaces must be used to indent lines; tabs are not allowed
Open

        $params = [

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getDisplayValue(string $key)

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Record name.

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                'linkicon' => 'fas fa-trash-alt',

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get the clean instance.

Spaces must be used to indent lines; tabs are not allowed
Open

        $db = App\Db::getInstance();

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        switch ($name) {

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

                break;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to save.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getFieldInstanceByName($name)

Spaces must be used to indent lines; tabs are not allowed
Open

            case 'status':

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        return 'index.php?parent=Settings&module=MeetingServices&view=Edit&record=' . $this->getId();

Spaces must be used to indent lines; tabs are not allowed
Open

            [

Spaces must be used to indent lines; tabs are not allowed
Open

                'linkurl' => "javascript:Settings_Vtiger_List_Js.deleteById('{$this->getId()}')",

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Cache::delete('MeetingService::getServices', '');

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->getModule()->getFormFields() as $fieldName => $fieldInfo) {

Spaces must be used to indent lines; tabs are not allowed
Open

                $fieldModel = $this->getFieldInstanceByName($fieldName)->getUITypeModel();

Spaces must be used to indent lines; tabs are not allowed
Open

        $value = $this->get($key);

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $instance = new self();

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

                $value = \App\Purifier::encodeHtml($value);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get the Edit View Url.

Spaces must be used to indent lines; tabs are not allowed
Open

                'linkicon' => 'yfi yfi-full-editing-view',

Spaces must be used to indent lines; tabs are not allowed
Open

        ];

Spaces must be used to indent lines; tabs are not allowed
Open

    public function delete()

Spaces must be used to indent lines; tabs are not allowed
Open

            $instance = new self();

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        return $instance;

Spaces must be used to indent lines; tabs are not allowed
Open

        } else {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        $fields = $this->getModule()->getFormFields();

Spaces must be used to indent lines; tabs are not allowed
Open

        return \Vtiger_Field_Model::init($moduleName, $params, $name);

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getEditViewUrl()

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

            ],

Spaces must be used to indent lines; tabs are not allowed
Open

                'linkclass' => 'btn btn-sm btn-danger text-white',

Spaces must be used to indent lines; tabs are not allowed
Open

            ],

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int $id

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function getInstanceById(int $id)

Spaces must be used to indent lines; tabs are not allowed
Open

            $instance->setData($row);

Spaces must be used to indent lines; tabs are not allowed
Open

        $tableName = $this->getModule()->baseTable;

Spaces must be used to indent lines; tabs are not allowed
Open

            $result = $db->createCommand()->insert($tableName, $params)->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($result && !empty($params['status'])) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    public function setDataFromRequest(App\Request $request)

Spaces must be used to indent lines; tabs are not allowed
Open

                $fieldModel->validate($value, true);

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get Module instance.

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!isset($this->module)) {

Spaces must be used to indent lines; tabs are not allowed
Open

            'label' => $fields[$name]['label'],

Spaces must be used to indent lines; tabs are not allowed
Open

                $params['uitype'] = 17;

Spaces must be used to indent lines; tabs are not allowed
Open

                $params['uitype'] = 56;

Spaces must be used to indent lines; tabs are not allowed
Open

        return $value;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $links = [];

Spaces must be used to indent lines; tabs are not allowed
Open

                'linklabel' => 'LBL_DELETE_RECORD',

Spaces must be used to indent lines; tabs are not allowed
Open

            ->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            $db->createCommand()->update($tableName, ['status' => 0], ['<>', 'id', $this->getId()])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

                $value = $request->getByType($fieldName, $fieldInfo['purifyType']);

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->module = Settings_Vtiger_Module_Model::getInstance('Settings:MeetingServices');

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

            'typeofdata' => $fields[$name]['required'] ? 'V~M' : 'V~O',

Spaces must be used to indent lines; tabs are not allowed
Open

                $params['typeofdata'] = 'C~O';

Spaces must be used to indent lines; tabs are not allowed
Open

    const KEY_LENGTH = 32;

Spaces must be used to indent lines; tabs are not allowed
Open

     * Record ID.

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getName()

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->get('url');

Spaces must be used to indent lines; tabs are not allowed
Open

                'linktype' => 'LISTVIEWRECORD',

Spaces must be used to indent lines; tabs are not allowed
Open

            $links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($row = \App\MeetingService::getService($id)) {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $type

Spaces must be used to indent lines; tabs are not allowed
Open

     * Sets data from request.

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $name

Spaces must be used to indent lines; tabs are not allowed
Open

                $value = \App\Language::translate(1 == $value ? 'LBL_ACTIVE' : 'LBL_INACTIVE', $this->getModule()->getName(true));

Spaces must be used to indent lines; tabs are not allowed
Open

     * @throws ReflectionException

Spaces must be used to indent lines; tabs are not allowed
Open

                $params['maximumlength'] = '250';

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                $this->set($fieldName, $fieldModel->getDBValue($value));

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return Settings_Vtiger_Module_Model

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        switch ($key) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

            'fieldvalue' => $this->get($name) ?? $fields[$name]['default'] ?? '',

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \Vtiger_Field_Model

Spaces must be used to indent lines; tabs are not allowed
Open

        $moduleName = $this->getModule()->getName(true);

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

            'maximumlength' => $fields[$name]['maximumlength'] ?? '',

Spaces must be used to indent lines; tabs are not allowed
Open

            case 'url':

Spaces must be used to indent lines; tabs are not allowed
Open

            case 'status':

Spaces must be used to indent lines; tabs are not allowed
Open

                break;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

                break;

Class name "Settings_MeetingServices_Record_Model" is not in camel caps format
Open

class Settings_MeetingServices_Record_Model extends Settings_Vtiger_Record_Model

There are no issues that match your filters.

Category
Status