Fix "Static call to instance method" errors on Models
Paris uses magic methods to create model instance for static calls
This commit is contained in:
@ -19,16 +19,23 @@ if(!defined('ABSPATH')) exit;
|
|||||||
* @method array getConnectionNames()
|
* @method array getConnectionNames()
|
||||||
* @method $this useIdColumn($id_column)
|
* @method $this useIdColumn($id_column)
|
||||||
* @method \ORM|bool findOne($id=null)
|
* @method \ORM|bool findOne($id=null)
|
||||||
|
* @method static \ORM|bool findOne($id=null)
|
||||||
* @method array|\IdiormResultSet findMany()
|
* @method array|\IdiormResultSet findMany()
|
||||||
|
* @method static array|\IdiormResultSet findMany()
|
||||||
* @method \IdiormResultSet findResultSet()
|
* @method \IdiormResultSet findResultSet()
|
||||||
* @method array findArray()
|
* @method array findArray()
|
||||||
|
* @method static array findArray()
|
||||||
* @method $this forceAllDirty()
|
* @method $this forceAllDirty()
|
||||||
* @method $this rawQuery($query, $parameters = array())
|
* @method $this rawQuery($query, $parameters = array())
|
||||||
|
* @method static $this rawQuery($query, $parameters = array())
|
||||||
* @method $this tableAlias($alias)
|
* @method $this tableAlias($alias)
|
||||||
* @method int countNullIdColumns()
|
* @method int countNullIdColumns()
|
||||||
* @method $this select($column, $alias=null)
|
* @method $this select($column, $alias=null)
|
||||||
|
* @method static $this select($column, $alias=null)
|
||||||
* @method $this selectExpr($expr, $alias=null)
|
* @method $this selectExpr($expr, $alias=null)
|
||||||
* @method \ORM selectMany($values)
|
* @method static $this selectExpr($expr, $alias=null)
|
||||||
|
* @method \ORM selectMany($values,...)
|
||||||
|
* @method static \ORM selectMany($values,...)
|
||||||
* @method \ORM selectManyExpr($values)
|
* @method \ORM selectManyExpr($values)
|
||||||
* @method $this rawJoin($table, $constraint, $table_alias, $parameters = array())
|
* @method $this rawJoin($table, $constraint, $table_alias, $parameters = array())
|
||||||
* @method $this innerJoin($table, $constraint, $table_alias=null)
|
* @method $this innerJoin($table, $constraint, $table_alias=null)
|
||||||
@ -36,11 +43,15 @@ if(!defined('ABSPATH')) exit;
|
|||||||
* @method $this rightOuterJoin($table, $constraint, $table_alias=null)
|
* @method $this rightOuterJoin($table, $constraint, $table_alias=null)
|
||||||
* @method $this fullOuterJoin($table, $constraint, $table_alias=null)
|
* @method $this fullOuterJoin($table, $constraint, $table_alias=null)
|
||||||
* @method $this where($column_name, $value=null)
|
* @method $this where($column_name, $value=null)
|
||||||
|
* @method static $this where($column_name, $value=null)
|
||||||
* @method $this whereEqual($column_name, $value=null)
|
* @method $this whereEqual($column_name, $value=null)
|
||||||
|
* @method static $this whereEqual($column_name, $value=null)
|
||||||
* @method $this whereNotEqual($column_name, $value=null)
|
* @method $this whereNotEqual($column_name, $value=null)
|
||||||
|
* @method static $this whereNotEqual($column_name, $value=null)
|
||||||
* @method $this whereIdIs($id)
|
* @method $this whereIdIs($id)
|
||||||
* @method $this whereAnyIs($values, $operator='=')
|
* @method $this whereAnyIs($values, $operator='=')
|
||||||
* @method array|string whereIdIn($ids)
|
* @method array|string whereIdIn($ids)
|
||||||
|
* @method static array|string whereIdIn($ids)
|
||||||
* @method $this whereLike($column_name, $value=null)
|
* @method $this whereLike($column_name, $value=null)
|
||||||
* @method $this whereNotLike($column_name, $value=null)
|
* @method $this whereNotLike($column_name, $value=null)
|
||||||
* @method $this whereGt($column_name, $value=null)
|
* @method $this whereGt($column_name, $value=null)
|
||||||
@ -48,13 +59,19 @@ if(!defined('ABSPATH')) exit;
|
|||||||
* @method $this whereGte($column_name, $value=null)
|
* @method $this whereGte($column_name, $value=null)
|
||||||
* @method $this whereLte($column_name, $value=null)
|
* @method $this whereLte($column_name, $value=null)
|
||||||
* @method $this whereIn($column_name, $values)
|
* @method $this whereIn($column_name, $values)
|
||||||
|
* @method static $this whereIn($column_name, $values)
|
||||||
* @method $this whereNotIn($column_name, $values)
|
* @method $this whereNotIn($column_name, $values)
|
||||||
* @method $this whereNull($column_name)
|
* @method $this whereNull($column_name)
|
||||||
|
* @method static $this whereNull($column_name)
|
||||||
* @method $this whereNotNull($column_name)
|
* @method $this whereNotNull($column_name)
|
||||||
|
* @method static $this whereNotNull($column_name)
|
||||||
* @method $this whereRaw($clause, $parameters=array())
|
* @method $this whereRaw($clause, $parameters=array())
|
||||||
|
* @method static $this whereRaw($clause, $parameters=array())
|
||||||
* @method $this deleteMany()
|
* @method $this deleteMany()
|
||||||
* @method $this orderByDesc($column_name)
|
* @method $this orderByDesc($column_name)
|
||||||
|
* @method static $this orderByDesc($column_name)
|
||||||
* @method $this orderByAsc($column_name)
|
* @method $this orderByAsc($column_name)
|
||||||
|
* @method static $this orderByAsc($column_name)
|
||||||
* @method $this orderByExpr($clause)
|
* @method $this orderByExpr($clause)
|
||||||
* @method $this groupBy($column_name)
|
* @method $this groupBy($column_name)
|
||||||
* @method $this groupByExpr($expr)
|
* @method $this groupByExpr($expr)
|
||||||
@ -76,6 +93,7 @@ if(!defined('ABSPATH')) exit;
|
|||||||
* @method bool setExpr($key, $value = null)
|
* @method bool setExpr($key, $value = null)
|
||||||
* @method bool isDirty($key)
|
* @method bool isDirty($key)
|
||||||
* @method $this table_alias($alias)
|
* @method $this table_alias($alias)
|
||||||
|
* @method static $this table_alias($alias)
|
||||||
*/
|
*/
|
||||||
class Model extends \Sudzy\ValidModel {
|
class Model extends \Sudzy\ValidModel {
|
||||||
const DUPLICATE_RECORD = 23000;
|
const DUPLICATE_RECORD = 23000;
|
||||||
|
@ -513,7 +513,7 @@ class Subscriber extends Model {
|
|||||||
$custom_field_ids = array_keys($custom_fields_data);
|
$custom_field_ids = array_keys($custom_fields_data);
|
||||||
|
|
||||||
// get custom fields
|
// get custom fields
|
||||||
$custom_fields = CustomField::findMany($custom_field_ids);
|
$custom_fields = CustomField::whereIdIn($custom_field_ids)->findMany();
|
||||||
|
|
||||||
foreach($custom_fields as $custom_field) {
|
foreach($custom_fields as $custom_field) {
|
||||||
$value = (isset($custom_fields_data[$custom_field->id])
|
$value = (isset($custom_fields_data[$custom_field->id])
|
||||||
|
@ -2,6 +2,5 @@ parameters:
|
|||||||
tmpDir: ../../temp/phpstan
|
tmpDir: ../../temp/phpstan
|
||||||
bootstrap: bootstrap.php
|
bootstrap: bootstrap.php
|
||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
- '#Static call to instance method MailPoet\\Models\\Model::#'
|
|
||||||
- '#Function members_register_.+ not found#'
|
- '#Function members_register_.+ not found#'
|
||||||
- '#MailPoet\\Premium\\DI\\ContainerConfigurator not found#' # this class is not available when premium is not active
|
- '#MailPoet\\Premium\\DI\\ContainerConfigurator not found#' # this class is not available when premium is not active
|
||||||
|
Reference in New Issue
Block a user