BaseField
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseField
{
/**
* @var \App\QueryGenerator
*/
The class BaseField has 14 public methods. Consider refactoring BaseField to keep number of public methods under 10. Open
class BaseField
{
/**
* @var \App\QueryGenerator
*/
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Class "BaseField" has 29 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class BaseField
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
Missing class import via use statement (line '362', column '45'). Open
return ['<>', $this->getColumnName(), new \yii\db\Expression($this->getColumnNameFromSource())];
- 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
The method getOrderBy has a boolean flag argument $order, which is a certain sign of a Single Responsibility Principle violation. Open
public function getOrderBy($order = false): array
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method __construct has a boolean flag argument $fieldModel, which is a certain sign of a Single Responsibility Principle violation. Open
public function __construct(\App\QueryGenerator $queryGenerator, $fieldModel = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '352', column '41'). Open
return [$this->getColumnName() => new \yii\db\Expression($this->getColumnNameFromSource())];
- 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 '\App\Log' in method 'getCondition'. Open
Log::error("Not found operator: $fn in " . __CLASS__);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getColumnNameFromSource uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$fieldModel = $this->queryGenerator->getModuleField($fieldName);
$this->queryGenerator->addTableToQuery($fieldModel->getTableName());
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Log' in method 'getCondition'. Open
Log::trace("Entering to $fn in " . __CLASS__);
- 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
Rename "$value" which has the same name as the field declared at line 45. Open
$value = $this->getValue();
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Rename "$operator" which has the same name as the field declared at line 50. Open
$operator = $this->operator;
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Rename "$fieldModel" which has the same name as the field declared at line 30. Open
$fieldModel = $this->queryGenerator->getRelatedModuleField($fieldName, $fieldModuleName);
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Call to method addTableToQuery
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$this->queryGenerator->addTableToQuery($fieldModel->getTableName());
- Exclude checks
Saw an @param annotation for value,
but it was not found in the param list of function __construct(\App\QueryGenerator $queryGenerator, \Vtiger_Field_Model|false $fieldModel = null)
Open
* @param array|string $value
- Exclude checks
Property \App\Conditions\QueryFields\BaseField->queryGenerator
has undeclared type \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
protected $queryGenerator;
- Exclude checks
Call to method getModule
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
return $this->queryGenerator->getModule();
- Exclude checks
Call to method getRelatedModuleField
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$fieldModel = $this->queryGenerator->getRelatedModuleField($fieldName, $fieldModuleName);
- Exclude checks
Call to method addRelatedJoin
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$this->queryGenerator->addRelatedJoin([
- Exclude checks
Default value for \Vtiger_Field_Model
$fieldModel
can't be false
Open
public function __construct(\App\QueryGenerator $queryGenerator, $fieldModel = false)
- Exclude checks
Call to method getModuleField
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$fieldModel = $this->queryGenerator->getModuleField($fieldName);
- Exclude checks
Assigning null
to property but \App\Conditions\QueryFields\BaseField->fullColumnName
is string
Open
$this->fullColumnName = null;
- Exclude checks
Call to method error
from undeclared class \App\Log
Open
Log::error("Not found operator: $fn in " . __CLASS__);
- Exclude checks
Parameter $queryGenerator
has undeclared type \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
public function __construct(\App\QueryGenerator $queryGenerator, $fieldModel = false)
- Exclude checks
Assigning null
to property but \App\Conditions\QueryFields\BaseField->tableName
is string
Open
$this->tableName = null;
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
return [$this->getColumnName() => new \yii\db\Expression($this->getColumnNameFromSource())];
- Exclude checks
Saw an @param annotation for operator,
but it was not found in the param list of function __construct(\App\QueryGenerator $queryGenerator, \Vtiger_Field_Model|false $fieldModel = null)
Open
* @param string $operator
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
Log::trace("Entering to $fn in " . __CLASS__);
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
return ['<>', $this->getColumnName(), new \yii\db\Expression($this->getColumnNameFromSource())];
- Exclude checks
Avoid variables with short names like $fn. Configured minimum length is 3. Open
$fn = 'operator' . ucfirst($operator ?? $this->operator);
- Read upRead up
- Exclude checks
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
* @var array|string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\QueryGenerator $queryGenerator
- 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
public function setOperator(string $operator): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->operator = strtolower($operator);
- 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
*/
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var array Related detail
- 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
*
- 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
}
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getModuleName(): string
- 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
* Set operator.
- 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
public function __construct(\App\QueryGenerator $queryGenerator, $fieldModel = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->queryGenerator->getModule();
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \Vtiger_Field_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $fieldModel;
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array|string $value
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $operator
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->queryGenerator = $queryGenerator;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- 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
protected $queryGenerator;
- 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
/**
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->fieldModel = $fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \Vtiger_Field_Model $fieldModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \App\QueryGenerator
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $fullColumnName;
- 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
* @param string $operator
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Constructor.
- 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
protected $tableName;
- 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
* Get module name.
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $operator;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $related = [];
- 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
/**
- 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
return $this->related;
- 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
[$fieldName, $fieldModuleName, $sourceFieldName] = array_pad(explode(':', $this->value), 3, '');
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Log::trace("Entering to $fn in " . __CLASS__);
- 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
{
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relatedModule' => $fieldModuleName,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relatedField' => $fieldName,
- 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
*
- 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
}
- 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
* @param array $relatedInfo
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
$fieldModel = $this->queryGenerator->getModuleField($fieldName);
- 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$table = $this->fieldModel->getTableName();
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return mixed
- 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
*/
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getColumnNameFromSource(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sourceField' => $sourceFieldName,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get condition.
- 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
*
- 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->related = $relatedInfo;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getRelated(): array
- 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
* Get order by.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $order
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->fullColumnName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get column name from source.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->queryGenerator->addRelatedJoin([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->queryGenerator->addTableToQuery($fieldModel->getTableName());
- 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
return $fieldModel ? ($fieldModel->getTableName() . $sourceFieldName . '.' . $fieldModel->getColumnName()) : '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $operator
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get table name.
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set table name.
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get value.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set related details.
- 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
}
- 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getTableName(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->related) {
- 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
return $this->tableName = $table;
- 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->tableName = $tableName;
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->{$fn}();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Auto operator, it allows you to use formulas: * and _.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorWca(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setRelated(array $relatedInfo): void
- 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
/**
- 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
public function getCondition(?string $operator = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool|\Vtiger_Field_Model
- 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
if ($sourceFieldName) {
- 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
Log::error("Not found operator: $fn in " . __CLASS__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorA(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Wildcard - asterisk.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get additional field model for list view.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->tableName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $tableName
- 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
*/
- 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
*
- 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
*
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getListViewFields()
- 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
* Get column name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getColumnName(): string
- 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
public function setTableName($tableName): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getValue()
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
if ($this->tableName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$table .= $this->related['sourceField'];
- 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
{
- 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
return $this->value;
- 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
* @param mixed $value
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- 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
public function getOrderBy($order = false): array
- 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
return ['like', $this->getColumnName(), str_replace('*', '%', "%{$this->getValue()}%"), false];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set value.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- 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
public function operatorE(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [$this->getColumnName() => $this->getValue()];
- 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
/**
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$order = $order && \App\Db::DESC === strtoupper($order) ? SORT_DESC : SORT_ASC;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->fullColumnName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->fullColumnName = $this->getTableName() . '.' . $this->fieldModel->getColumnName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = $this->queryGenerator->getRelatedModuleField($fieldName, $fieldModuleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array|bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fn = 'operator' . ucfirst($operator ?? $this->operator);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (method_exists($this, $fn)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->getCondition($this->getOperator());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Search for a specified pattern in a column.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
public function setValue($value)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- 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
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Starts with operator.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['like', $this->getColumnName(), $this->getValue() . '%', false];
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $operator;
- 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
* Get related details.
- 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
return [$this->getColumnName() => $order];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- 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
*/
- 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
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
return [(\is_array($value) ? 'not in' : '<>'), $this->getColumnName(), $value];
- 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
*/
- 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
];
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->fullColumnName = null;
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Not equal operator.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorN(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Is not empty operator.
- 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
$operator = 'c';
- 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
}
- 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
* Get field model.
- 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
return $this->fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('a' === $this->operator) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$operator = 'wca';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorEw()
- 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
{
- 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
* Does not contain operator.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorEf(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [$this->getColumnName() => new \yii\db\Expression($this->getColumnNameFromSource())];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->value = $value;
- 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
*
- 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
*/
- 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
}
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets real operator.
- 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
return ['like', $this->getColumnName(), $this->getValue()];
- 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
['not', [$this->getColumnName() => null]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['not like', $this->getColumnName(), $this->getValue()];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Is not equal to selected field operator.
- 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
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['<>', $this->getColumnName(), new \yii\db\Expression($this->getColumnNameFromSource())];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Vtiger_Field_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== strpos($this->getValue(), '*')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Ends with operator.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['=', $this->getColumnName(), ''],
- 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
/**
- 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
public function operatorNf(): array
- 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
*/
- 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
public function operatorNy(): array
- 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
* @return array
- 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
*
- 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
}
- 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
public function operatorC(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Equals operator.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorS()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorK(): array
- 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
* Contains operator.
- 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
return ['like', $this->getColumnName(), '%' . $this->getValue(), false];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
public function getField()
- 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
}
- 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
*/
- 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
return ['or',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Is equal to selected field operator.
- 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
public function getOperator(): string
- 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
$value = $this->getValue();
- 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
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operatorY(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[$this->getColumnName() => null],
- 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
* Invoked when object is cloning.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->tableName = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
}
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- 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
$operator = $this->operator;
- 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
* Is empty operator.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['and',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['<>', $this->getColumnName(), ''],
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __clone()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks