Method testAdvancedConditions
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAdvancedConditions()
{
$moduleName = 'Accounts';
$accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
$contactId = \Tests\Base\C_RecordActions::createContactRecord()->getId();
Missing class import via use statement (line '89', column '38'). Open
$this->logs['DocumentsRel'] = (new \App\Db\Query())->from('vtiger_senotesrel')->all();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '59', column '25'). Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '27', column '25'). Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '49', column '23'). Open
'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '88', column '35'). Open
$this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '50', column '23'). Open
'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '80', column '25'). Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\Tests\Base\C_RecordActions' in method 'testAdvancedConditions'. Open
$accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Condition' in method 'testAdvancedConditions'. Open
$searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_1', 'a', $contactId]]]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Tests\Base\C_RecordActions' in method 'testAdvancedConditions'. Open
$documentModel = \Tests\Base\C_RecordActions::createDocumentsRecord();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Condition' in method 'testAdvancedConditions'. Open
$searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_' . $relationId, 'a', $documentModel->getId()]]]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "value" 3 times. Open
'value' => $contactId,
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "relationId" 3 times. Open
$queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => ['1']]);
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "accountname" 7 times. Open
'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "deleted" 3 times. Open
'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "vtiger_crmentity" 3 times. Open
'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Call to undeclared method \Tests\App\QueryGenerator::assertEquals
Open
$this->assertEquals([
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Exclude checks
Call to undeclared method \Tests\App\QueryGenerator::assertEquals
Open
$this->assertEquals($accountModel->get('accountname'), $row['accountname']);
- Exclude checks
Call to undeclared method \Tests\App\QueryGenerator::assertEquals
Open
$this->assertEquals($accountModel->getId(), $row['id']);
- Exclude checks
Call to undeclared method \Tests\App\QueryGenerator::assertEquals
Open
$this->assertEquals($accountModel->get('accountname'), $row['accountname']);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
- Exclude checks
Call to method __construct
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Exclude checks
Argument 1 (sourceRecordId)
is null
but \Vtiger_Relation_Model::addRelation()
takes int
defined at /code/modules/Vtiger/models/Relation.php:625
Open
\Vtiger_Relation_Model::getInstanceById($relationId)->addRelation($row['id'], $documentModel->getId());
- Exclude checks
Call to undeclared method \Tests\App\QueryGenerator::assertEquals
Open
$this->assertEquals($accountModel->getId(), $row['id']);
- Exclude checks
Call to method createQuery
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$this->logs['AccountsAdvancedConditions'] = $rows = $queryGenerator->createQuery()->createCommand()->queryAllByGroup(1);
- Exclude checks
Invalid offset "accountname"
of array type array{}
Open
$this->assertEquals($accountModel->get('accountname'), $row['accountname']);
- Exclude checks
Call to method parseBaseSearchParamsToCondition
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$this->logs['DocumentsRel'] = (new \App\Db\Query())->from('vtiger_senotesrel')->all();
- Exclude checks
Call to method parseAdvFilter
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->parseAdvFilter($transformedSearchParams);
- Exclude checks
Call to method createQuery
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$row = $queryGenerator->createQuery()->one() ?? [];
- Exclude checks
Call to undeclared method \Tests\App\QueryGenerator::assertArrayHasKey
Open
$this->assertArrayHasKey($accountModel->getId(), $rows);
- Exclude checks
Call to method setAdvancedConditions
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => ['1']]);
- Exclude checks
Call to method createQuery
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
'query' => $queryGenerator->createQuery()->createCommand()->getRawSql(),
- Exclude checks
Invalid offset "id"
of array type array{}
Open
$this->assertEquals($accountModel->getId(), $row['id']);
- Exclude checks
Call to method setFields
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->setFields(['id', 'accountname']);
- Exclude checks
Call to method initForDefaultCustomView
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->initForDefaultCustomView();
- Exclude checks
Call to method setFields
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->setFields(['id', 'accountname']);
- Exclude checks
Invalid offset "id"
of array type array{}
Open
\Vtiger_Relation_Model::getInstanceById($relationId)->addRelation($row['id'], $documentModel->getId());
- Exclude checks
Invalid offset "accountname"
of array type array{}
Open
$this->assertEquals($accountModel->get('accountname'), $row['accountname']);
- Exclude checks
Invalid offset "id"
of array type array{}
Open
$this->assertEquals($accountModel->getId(), $row['id']);
- Exclude checks
Call to method createQuery
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$row = $queryGenerator->createQuery()->one() ?? [];
- Exclude checks
Call to method parseBaseSearchParamsToCondition
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
- Exclude checks
Call to undeclared method \Tests\App\QueryGenerator::assertEquals
Open
$this->assertEquals([
- Exclude checks
Call to method parseAdvFilter
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->parseAdvFilter($transformedSearchParams);
- Exclude checks
Call to method setAdvancedConditions
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->setAdvancedConditions([
- Exclude checks
Call to method __construct
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Exclude checks
Call to method setAdvancedConditions
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => [$relationId]]);
- Exclude checks
Call to method __construct
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Exclude checks
Avoid excessively long variable names like $transformedSearchParams. Keep variable name length under 20. Open
$transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => ['1']]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row = $queryGenerator->createQuery()->one() ?? [];
- Exclude checks
Line exceeds 120 characters; contains 242 characters Open
'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->parseAdvFilter($transformedSearchParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row = $queryGenerator->createQuery()->one() ?? [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Exclude checks
Line exceeds 120 characters; contains 253 characters Open
'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertEquals($accountModel->get('accountname'), $row['accountname']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->logs['DocumentsRel'] = (new \App\Db\Query())->from('vtiger_senotesrel')->all();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = 'Accounts';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
- Exclude checks
Line exceeds 120 characters; contains 180 characters Open
'relationConditions' => ['condition' => 'AND', 'rules' => [['fieldname' => 'notes_title:Documents', 'operator' => 'e', 'value' => $documentModel->get('notes_title')]]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$contactId = \Tests\Base\C_RecordActions::createContactRecord()->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'field_name' => 'relationColumn_1',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_field_name' => false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertArrayHasKey($accountModel->getId(), $rows);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'comparator' => 'a',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\Vtiger_Relation_Model::getInstanceById($relationId)->addRelation($row['id'], $documentModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_1', 'a', $contactId]]]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'value' => $contactId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'contactId' => $contactId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->setFields(['id', 'accountname']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->initForDefaultCustomView();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_field_name' => false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relationId = 9;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$documentModel = \Tests\Base\C_RecordActions::createDocumentsRecord();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'value' => $documentModel->getId(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'and' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], $transformedSearchParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->logs['AccountsAdvancedConditions'] = $rows = $queryGenerator->createQuery()->createCommand()->queryAllByGroup(1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Advanced conditions test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertEquals([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'and' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->parseAdvFilter($transformedSearchParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->logs['DocumentsId'] = $documentModel->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator = new \App\QueryGenerator($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->setAdvancedConditions([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'query' => $queryGenerator->createQuery()->createCommand()->getRawSql(),
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
$searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_' . $relationId, 'a', $documentModel->getId()]]]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relationId' => $relationId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertEquals([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'field_name' => 'relationColumn_' . $relationId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module_name' => false,
- Exclude checks
Line exceeds 120 characters; contains 250 characters Open
$this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], $transformedSearchParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertEquals($accountModel->getId(), $row['id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->logs = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module_name' => false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->setFields(['id', 'accountname']);
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$this->logs['AccountsAdvancedConditions'] = $rows = $queryGenerator->createQuery()->createCommand()->queryAllByGroup(1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testAdvancedConditions()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'accountId' => $accountModel->getId(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertEquals($accountModel->get('accountname'), $row['accountname']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => [$relationId]]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_' . $relationId, 'a', $documentModel->getId()]]]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'comparator' => 'a',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertEquals($accountModel->getId(), $row['id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relationConditions' => ['condition' => 'AND', 'rules' => [['fieldname' => 'notes_title:Documents', 'operator' => 'e', 'value' => $documentModel->get('notes_title')]]],
- Exclude checks