Completed
Push — development ( 9ca09c...006c45 )
by Andrij
09:50
created

BannerImageI18nTableMap   D

Complexity

Total Complexity 81

Size/Duplication

Total Lines 484
Duplicated Lines 8.88 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 81
c 1
b 0
f 0
lcom 1
cbo 2
dl 43
loc 484
rs 4.8717

15 Methods

Rating   Name   Duplication   Size   Complexity  
A buildRelations() 10 10 1
B addInstanceToPool() 9 9 9
A getOMClass() 0 4 2
A addSelectColumns() 0 18 2
A getTableMap() 0 4 1
A buildTableMap() 7 7 2
A doDeleteAll() 0 4 1
A initialize() 17 17 1
C removeInstanceFromPool() 0 21 21
B getPrimaryKeyHashFromRow() 0 9 21
A getPrimaryKeyFromRow() 0 17 3
A populateObject() 0 18 2
B populateObjects() 0 25 3
D doDelete() 0 39 9
A doInsert() 0 22 3

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like BannerImageI18nTableMap often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use BannerImageI18nTableMap, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace xbanners\models\Map;
4
5
use Propel\Runtime\Propel;
6
use Propel\Runtime\ActiveQuery\Criteria;
7
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
8
use Propel\Runtime\Connection\ConnectionInterface;
9
use Propel\Runtime\DataFetcher\DataFetcherInterface;
10
use Propel\Runtime\Exception\PropelException;
11
use Propel\Runtime\Map\RelationMap;
12
use Propel\Runtime\Map\TableMap;
13
use Propel\Runtime\Map\TableMapTrait;
14
use xbanners\models\BannerImageI18n;
15
use xbanners\models\BannerImageI18nQuery;
16
17
18
/**
19
 * This class defines the structure of the 'banner_image_i18n' table.
20
 *
21
 *
22
 *
23
 * This map class is used by Propel to do runtime db structure discovery.
0 ignored issues
show
introduced by
There must be exactly one blank line between descriptions in a doc comment
Loading history...
24
 * For example, the createSelectSql() method checks the type of a given column used in an
25
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
26
 * (i.e. if it's a text column type).
27
 *
28
 */
0 ignored issues
show
introduced by
Additional blank lines found at end of doc comment
Loading history...
29
class BannerImageI18nTableMap extends TableMap
30
{
0 ignored issues
show
introduced by
Opening brace of a class must be on the same line as the definition
Loading history...
31
    use InstancePoolTrait;
32
    use TableMapTrait;
33
34
    /**
35
     * The (dot-path) name of this class
36
     */
37
    const CLASS_NAME = 'xbanners.models.Map.BannerImageI18nTableMap';
38
39
    /**
40
     * The default database name for this class
41
     */
42
    const DATABASE_NAME = 'Shop';
43
44
    /**
45
     * The table name for this class
46
     */
47
    const TABLE_NAME = 'banner_image_i18n';
48
49
    /**
50
     * The related Propel class for this table
51
     */
52
    const OM_CLASS = '\\xbanners\\models\\BannerImageI18n';
53
54
    /**
55
     * A class that can be returned by this tableMap
56
     */
57
    const CLASS_DEFAULT = 'xbanners.models.BannerImageI18n';
58
59
    /**
60
     * The total number of columns
61
     */
62
    const NUM_COLUMNS = 6;
63
64
    /**
65
     * The number of lazy-loaded columns
66
     */
67
    const NUM_LAZY_LOAD_COLUMNS = 0;
68
69
    /**
70
     * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
71
     */
72
    const NUM_HYDRATE_COLUMNS = 6;
73
74
    /**
75
     * the column name for the id field
76
     */
77
    const COL_ID = 'banner_image_i18n.id';
78
79
    /**
80
     * the column name for the locale field
81
     */
82
    const COL_LOCALE = 'banner_image_i18n.locale';
83
84
    /**
85
     * the column name for the src field
86
     */
87
    const COL_SRC = 'banner_image_i18n.src';
88
89
    /**
90
     * the column name for the name field
91
     */
92
    const COL_NAME = 'banner_image_i18n.name';
93
94
    /**
95
     * the column name for the clicks field
96
     */
97
    const COL_CLICKS = 'banner_image_i18n.clicks';
98
99
    /**
100
     * the column name for the description field
101
     */
102
    const COL_DESCRIPTION = 'banner_image_i18n.description';
103
104
    /**
105
     * The default string format for model objects of the related table
106
     */
107
    const DEFAULT_STRING_FORMAT = 'YAML';
108
109
    /**
110
     * holds an array of fieldnames
111
     *
112
     * first dimension keys are the type constants
0 ignored issues
show
introduced by
Doc comment long description must start with a capital letter
Loading history...
113
     * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
114
     */
115
    protected static $fieldNames = array (
0 ignored issues
show
Coding Style introduced by
There must be no space between the "array" keyword and the opening parenthesis
Loading history...
116
        self::TYPE_PHPNAME       => array('Id', 'Locale', 'Src', 'Name', 'Clicks', 'Description', ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
117
        self::TYPE_CAMELNAME     => array('id', 'locale', 'src', 'name', 'clicks', 'description', ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
118
        self::TYPE_COLNAME       => array(BannerImageI18nTableMap::COL_ID, BannerImageI18nTableMap::COL_LOCALE, BannerImageI18nTableMap::COL_SRC, BannerImageI18nTableMap::COL_NAME, BannerImageI18nTableMap::COL_CLICKS, BannerImageI18nTableMap::COL_DESCRIPTION, ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
119
        self::TYPE_FIELDNAME     => array('id', 'locale', 'src', 'name', 'clicks', 'description', ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
120
        self::TYPE_NUM           => array(0, 1, 2, 3, 4, 5, )
0 ignored issues
show
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
121
    );
122
123
    /**
124
     * holds an array of keys for quick access to the fieldnames array
125
     *
126
     * first dimension keys are the type constants
0 ignored issues
show
introduced by
Doc comment long description must start with a capital letter
Loading history...
127
     * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
128
     */
129
    protected static $fieldKeys = array (
0 ignored issues
show
Coding Style introduced by
There must be no space between the "array" keyword and the opening parenthesis
Loading history...
130
        self::TYPE_PHPNAME       => array('Id' => 0, 'Locale' => 1, 'Src' => 2, 'Name' => 3, 'Clicks' => 4, 'Description' => 5, ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
131
        self::TYPE_CAMELNAME     => array('id' => 0, 'locale' => 1, 'src' => 2, 'name' => 3, 'clicks' => 4, 'description' => 5, ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
132
        self::TYPE_COLNAME       => array(BannerImageI18nTableMap::COL_ID => 0, BannerImageI18nTableMap::COL_LOCALE => 1, BannerImageI18nTableMap::COL_SRC => 2, BannerImageI18nTableMap::COL_NAME => 3, BannerImageI18nTableMap::COL_CLICKS => 4, BannerImageI18nTableMap::COL_DESCRIPTION => 5, ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
133
        self::TYPE_FIELDNAME     => array('id' => 0, 'locale' => 1, 'src' => 2, 'name' => 3, 'clicks' => 4, 'description' => 5, ),
0 ignored issues
show
introduced by
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
Loading history...
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
134
        self::TYPE_NUM           => array(0, 1, 2, 3, 4, 5, )
0 ignored issues
show
Coding Style introduced by
Comma not allowed after last value in single-line array declaration
Loading history...
introduced by
There should be no white space before a closing ")"
Loading history...
135
    );
136
137
    /**
138
     * Initialize the table attributes and columns
139
     * Relations are not initialized by this method since they are lazy loaded
140
     *
141
     * @return void
0 ignored issues
show
introduced by
If there is no return value for a function, there must not be a @return tag.
Loading history...
142
     * @throws PropelException
0 ignored issues
show
introduced by
Comment missing or not on the next line for @throws tag in function comment
Loading history...
143
     */
144 View Code Duplication
    public function initialize()
145
    {
146
        // attributes
147
        $this->setName('banner_image_i18n');
148
        $this->setPhpName('BannerImageI18n');
149
        $this->setIdentifierQuoting(false);
150
        $this->setClassName('\\xbanners\\models\\BannerImageI18n');
151
        $this->setPackage('xbanners.models');
152
        $this->setUseIdGenerator(false);
153
        // columns
154
        $this->addForeignPrimaryKey('id', 'Id', 'INTEGER' , 'banner_image', 'id', true, 11, null);
0 ignored issues
show
Coding Style introduced by
Space found before comma in function call
Loading history...
155
        $this->addPrimaryKey('locale', 'Locale', 'VARCHAR', true, 5, 'ru');
156
        $this->addColumn('src', 'Src', 'VARCHAR', false, 255, null);
157
        $this->addColumn('name', 'Name', 'VARCHAR', false, 255, null);
158
        $this->addColumn('clicks', 'Clicks', 'INTEGER', false, 20, null);
159
        $this->addColumn('description', 'Description', 'LONGVARCHAR', false, null, null);
160
    } // initialize()
161
162
    /**
163
     * Build the RelationMap objects for this table relationships
164
     */
165 View Code Duplication
    public function buildRelations()
166
    {
167
        $this->addRelation('BannerImage', '\\xbanners\\models\\BannerImage', RelationMap::MANY_TO_ONE, array (
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, each argument should be on a separate line.

For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
);
Loading history...
Coding Style introduced by
There must be no space between the "array" keyword and the opening parenthesis
Loading history...
168
  0 =>
169
  array (
0 ignored issues
show
Coding Style introduced by
There must be no space between the "array" keyword and the opening parenthesis
Loading history...
170
    0 => ':id',
171
    1 => ':id',
172
  ),
173
), 'CASCADE', null, null, false);
0 ignored issues
show
introduced by
Line indented incorrectly; expected at least 8 spaces, found 0
Loading history...
Coding Style introduced by
For multi-line function calls, each argument should be on a separate line.

For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
);
Loading history...
174
    } // buildRelations()
175
176
    /**
177
     * Adds an object to the instance pool.
178
     *
179
     * Propel keeps cached copies of objects in an instance pool when they are retrieved
180
     * from the database. In some cases you may need to explicitly add objects
181
     * to the cache in order to ensure that the same objects are always returned by find*()
182
     * and findPk*() calls.
183
     *
184
     * @param \xbanners\models\BannerImageI18n $obj A \xbanners\models\BannerImageI18n object.
185
     * @param string $key             (optional) key to use for instance map (for performance boost if key was already calculated externally).
186
     */
187 View Code Duplication
    public static function addInstanceToPool($obj, $key = null)
188
    {
189
        if (Propel::isInstancePoolingEnabled()) {
190
            if (null === $key) {
191
                $key = serialize([(null === $obj->getId() || is_scalar($obj->getId()) || is_callable([$obj->getId(), '__toString']) ? (string) $obj->getId() : $obj->getId()), (null === $obj->getLocale() || is_scalar($obj->getLocale()) || is_callable([$obj->getLocale(), '__toString']) ? (string) $obj->getLocale() : $obj->getLocale())]);
192
            } // if key === null
193
            self::$instances[$key] = $obj;
194
        }
195
    }
196
197
    /**
198
     * Removes an object from the instance pool.
199
     *
200
     * Propel keeps cached copies of objects in an instance pool when they are retrieved
201
     * from the database.  In some cases -- especially when you override doDelete
202
     * methods in your stub classes -- you may need to explicitly remove objects
203
     * from the cache in order to prevent returning objects that no longer exist.
204
     *
205
     * @param mixed $value A \xbanners\models\BannerImageI18n object or a primary key value.
206
     */
207
    public static function removeInstanceFromPool($value)
208
    {
209
        if (Propel::isInstancePoolingEnabled() && null !== $value) {
210
            if (is_object($value) && $value instanceof \xbanners\models\BannerImageI18n) {
211
                $key = serialize([(null === $value->getId() || is_scalar($value->getId()) || is_callable([$value->getId(), '__toString']) ? (string) $value->getId() : $value->getId()), (null === $value->getLocale() || is_scalar($value->getLocale()) || is_callable([$value->getLocale(), '__toString']) ? (string) $value->getLocale() : $value->getLocale())]);
212
213
            } elseif (is_array($value) && count($value) === 2) {
214
                // assume we've been passed a primary key";
215
                $key = serialize([(null === $value[0] || is_scalar($value[0]) || is_callable([$value[0], '__toString']) ? (string) $value[0] : $value[0]), (null === $value[1] || is_scalar($value[1]) || is_callable([$value[1], '__toString']) ? (string) $value[1] : $value[1])]);
216
            } elseif ($value instanceof Criteria) {
0 ignored issues
show
Bug introduced by
The class Propel\Runtime\ActiveQuery\Criteria does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
217
                self::$instances = [];
218
219
                return;
220
            } else {
221
                $e = new PropelException("Invalid value passed to removeInstanceFromPool().  Expected primary key or \xbanners\models\BannerImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true)));
222
                throw $e;
223
            }
224
225
            unset(self::$instances[$key]);
226
        }
227
    }
228
229
    /**
230
     * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
231
     *
232
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
233
     * a multi-column primary key, a serialize()d version of the primary key will be returned.
234
     *
235
     * @param array  $row       resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
236
     * @param int    $offset    The 0-based offset for reading from the resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 4 found
Loading history...
237
     * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
238
     *                           TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
239
     *
240
     * @return string The primary key hash of the row
0 ignored issues
show
Documentation introduced by
Should the return type not be null|string?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
241
     */
242
    public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
243
    {
244
        // If the PK cannot be derived from the row, return NULL.
245
        if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null && $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] === null) {
246
            return null;
247
        }
248
249
        return serialize([(null === $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] || is_scalar($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]) || is_callable([$row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)], '__toString']) ? (string) $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] : $row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)]), (null === $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] || is_scalar($row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)]) || is_callable([$row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)], '__toString']) ? (string) $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)] : $row[TableMap::TYPE_NUM == $indexType ? 1 + $offset : static::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)])]);
250
    }
251
252
    /**
253
     * Retrieves the primary key from the DB resultset row
254
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
255
     * a multi-column primary key, an array of the primary key columns will be returned.
256
     *
257
     * @param array  $row       resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
258
     * @param int    $offset    The 0-based offset for reading from the resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 4 found
Loading history...
259
     * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
260
     *                           TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
261
     *
262
     * @return mixed The primary key of the row
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<integer|string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
263
     */
264
    public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
265
    {
266
            $pks = [];
267
268
        $pks[] = (int) $row[
0 ignored issues
show
Coding Style introduced by
Space found after square bracket; expected "[$indexType" but found "[
$indexType"
Loading history...
269
            $indexType == TableMap::TYPE_NUM
270
                ? 0 + $offset
271
                : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
272
        ];
0 ignored issues
show
Coding Style introduced by
Space found before square bracket; expected ")]" but found ")
]"
Loading history...
273
        $pks[] = (string) $row[
0 ignored issues
show
Coding Style introduced by
Space found after square bracket; expected "[$indexType" but found "[
$indexType"
Loading history...
274
            $indexType == TableMap::TYPE_NUM
275
                ? 1 + $offset
276
                : self::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)
277
        ];
0 ignored issues
show
Coding Style introduced by
Space found before square bracket; expected ")]" but found ")
]"
Loading history...
278
279
        return $pks;
280
    }
281
282
    /**
283
     * The class that the tableMap will make instances of.
284
     *
285
     * If $withPrefix is true, the returned path
286
     * uses a dot-path notation which is translated into a path
287
     * relative to a location on the PHP include_path.
288
     * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
289
     *
290
     * @param boolean $withPrefix Whether or not to return the path with the class name
291
     * @return string path.to.ClassName
292
     */
293
    public static function getOMClass($withPrefix = true)
294
    {
295
        return $withPrefix ? BannerImageI18nTableMap::CLASS_DEFAULT : BannerImageI18nTableMap::OM_CLASS;
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
296
    }
297
298
    /**
299
     * Populates an object of the default type or an object that inherit from the default.
300
     *
301
     * @param array  $row       row returned by DataFetcher->fetch().
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
302
     * @param int    $offset    The 0-based offset for reading from the resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 4 found
Loading history...
303
     * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
304
                                 One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
305
     *                           TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
306
     *
307
     * @throws PropelException Any exceptions caught during processing will be
308
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
309
     * @return array           (BannerImageI18n object, last column rank)
310
     */
311
    public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
312
    {
313
        $key = BannerImageI18nTableMap::getPrimaryKeyHashFromRow($row, $offset, $indexType);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
314
        if (null !== ($obj = BannerImageI18nTableMap::getInstanceFromPool($key))) {
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
315
            // We no longer rehydrate the object, since this can cause data loss.
316
            // See http://www.propelorm.org/ticket/509
317
            // $obj->hydrate($row, $offset, true); // rehydrate
318
            $col = $offset + BannerImageI18nTableMap::NUM_HYDRATE_COLUMNS;
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
319
        } else {
320
            $cls = BannerImageI18nTableMap::OM_CLASS;
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
321
            /** @var BannerImageI18n $obj */
322
            $obj = new $cls();
323
            $col = $obj->hydrate($row, $offset, false, $indexType);
324
            BannerImageI18nTableMap::addInstanceToPool($obj, $key);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
325
        }
326
327
        return array($obj, $col);
328
    }
329
330
    /**
331
     * The returned array will contain objects of the default type or
332
     * objects that inherit from the default.
333
     *
334
     * @param DataFetcherInterface $dataFetcher
335
     * @return array
336
     * @throws PropelException Any exceptions caught during processing will be
337
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
338
     */
339
    public static function populateObjects(DataFetcherInterface $dataFetcher)
340
    {
341
        $results = array();
342
343
        // set the class once to avoid overhead in the loop
344
        $cls = static::getOMClass(false);
345
        // populate the object(s)
346
        while ($row = $dataFetcher->fetch()) {
347
            $key = BannerImageI18nTableMap::getPrimaryKeyHashFromRow($row, 0, $dataFetcher->getIndexType());
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
348
            if (null !== ($obj = BannerImageI18nTableMap::getInstanceFromPool($key))) {
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
349
                // We no longer rehydrate the object, since this can cause data loss.
350
                // See http://www.propelorm.org/ticket/509
351
                // $obj->hydrate($row, 0, true); // rehydrate
352
                $results[] = $obj;
353
            } else {
354
                /** @var BannerImageI18n $obj */
355
                $obj = new $cls();
356
                $obj->hydrate($row);
357
                $results[] = $obj;
358
                BannerImageI18nTableMap::addInstanceToPool($obj, $key);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
359
            } // if key exists
360
        }
361
362
        return $results;
363
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
364
    /**
365
     * Add all the columns needed to create a new object.
366
     *
367
     * Note: any columns that were marked with lazyLoad="true" in the
368
     * XML schema will not be added to the select list and only loaded
369
     * on demand.
370
     *
371
     * @param Criteria $criteria object containing the columns to add.
372
     * @param string   $alias    optional table alias
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 3 found
Loading history...
373
     * @throws PropelException Any exceptions caught during processing will be
374
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
375
     */
376
    public static function addSelectColumns(Criteria $criteria, $alias = null)
377
    {
378
        if (null === $alias) {
379
            $criteria->addSelectColumn(BannerImageI18nTableMap::COL_ID);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
380
            $criteria->addSelectColumn(BannerImageI18nTableMap::COL_LOCALE);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
381
            $criteria->addSelectColumn(BannerImageI18nTableMap::COL_SRC);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
382
            $criteria->addSelectColumn(BannerImageI18nTableMap::COL_NAME);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
383
            $criteria->addSelectColumn(BannerImageI18nTableMap::COL_CLICKS);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
384
            $criteria->addSelectColumn(BannerImageI18nTableMap::COL_DESCRIPTION);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
385
        } else {
386
            $criteria->addSelectColumn($alias . '.id');
387
            $criteria->addSelectColumn($alias . '.locale');
388
            $criteria->addSelectColumn($alias . '.src');
389
            $criteria->addSelectColumn($alias . '.name');
390
            $criteria->addSelectColumn($alias . '.clicks');
391
            $criteria->addSelectColumn($alias . '.description');
392
        }
393
    }
394
395
    /**
396
     * Returns the TableMap related to this object.
397
     * This method is not needed for general use but a specific application could have a need.
398
     * @return TableMap
399
     * @throws PropelException Any exceptions caught during processing will be
400
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
401
     */
402
    public static function getTableMap()
403
    {
404
        return Propel::getServiceContainer()->getDatabaseMap(BannerImageI18nTableMap::DATABASE_NAME)->getTable(BannerImageI18nTableMap::TABLE_NAME);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
405
    }
406
407
    /**
408
     * Add a TableMap instance to the database for this tableMap class.
409
     */
410 View Code Duplication
    public static function buildTableMap()
411
    {
412
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(BannerImageI18nTableMap::DATABASE_NAME);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
413
        if (!$dbMap->hasTable(BannerImageI18nTableMap::TABLE_NAME)) {
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
414
            $dbMap->addTableObject(new BannerImageI18nTableMap());
415
        }
416
    }
417
418
    /**
419
     * Performs a DELETE on the database, given a BannerImageI18n or Criteria object OR a primary key value.
420
     *
421
     * @param mixed               $values Criteria or BannerImageI18n object or primary key or array of primary keys
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 15 found
Loading history...
422
     *              which is used to create the DELETE statement
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
423
     * @param  ConnectionInterface $con the connection to use
424
     * @return int             The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
425
     *                         if supported by native driver or if emulated using Propel.
426
     * @throws PropelException Any exceptions caught during processing will be
427
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
428
     */
429
     public static function doDelete($values, ConnectionInterface $con = null)
430
     {
431
        if (null === $con) {
432
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageI18nTableMap::DATABASE_NAME);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
433
        }
434
435
        if ($values instanceof Criteria) {
0 ignored issues
show
Bug introduced by
The class Propel\Runtime\ActiveQuery\Criteria does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
436
            // rename for clarity
437
            $criteria = $values;
438
        } elseif ($values instanceof \xbanners\models\BannerImageI18n) { // it's a model object
0 ignored issues
show
introduced by
There should be no white space after an opening "{"
Loading history...
439
            // create criteria based on pk values
440
            $criteria = $values->buildPkeyCriteria();
441
        } else { // it's a primary key, or an array of pks
0 ignored issues
show
introduced by
There should be no white space after an opening "{"
Loading history...
442
            $criteria = new Criteria(BannerImageI18nTableMap::DATABASE_NAME);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
443
            // primary key is composite; we therefore, expect
444
            // the primary key passed to be an array of pkey values
445
            if (count($values) == count($values, COUNT_RECURSIVE)) {
446
                // array is not multi-dimensional
447
                $values = array($values);
448
            }
449
            foreach ($values as $value) {
450
                $criterion = $criteria->getNewCriterion(BannerImageI18nTableMap::COL_ID, $value[0]);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
451
                $criterion->addAnd($criteria->getNewCriterion(BannerImageI18nTableMap::COL_LOCALE, $value[1]));
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
452
                $criteria->addOr($criterion);
453
            }
454
        }
455
456
        $query = BannerImageI18nQuery::create()->mergeWith($criteria);
457
458
        if ($values instanceof Criteria) {
0 ignored issues
show
Bug introduced by
The class Propel\Runtime\ActiveQuery\Criteria does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
459
            BannerImageI18nTableMap::clearInstancePool();
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
460
        } elseif (!is_object($values)) { // it's a primary key, or an array of pks
0 ignored issues
show
introduced by
There should be no white space after an opening "{"
Loading history...
461
            foreach ((array) $values as $singleval) {
462
                BannerImageI18nTableMap::removeInstanceFromPool($singleval);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
463
            }
464
        }
465
466
        return $query->delete($con);
467
    }
0 ignored issues
show
introduced by
Closing brace indented incorrectly; expected 5 spaces, found 4
Loading history...
468
469
    /**
470
     * Deletes all rows from the banner_image_i18n table.
471
     *
472
     * @param ConnectionInterface $con the connection to use
473
     * @return int The number of affected rows (if supported by underlying database driver).
474
     */
475
    public static function doDeleteAll(ConnectionInterface $con = null)
476
    {
477
        return BannerImageI18nQuery::create()->doDeleteAll($con);
478
    }
479
480
    /**
481
     * Performs an INSERT on the database, given a BannerImageI18n or Criteria object.
482
     *
483
     * @param mixed               $criteria Criteria or BannerImageI18n object containing data that is used to create the INSERT statement.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 15 found
Loading history...
484
     * @param ConnectionInterface $con the ConnectionInterface connection to use
485
     * @return mixed           The new primary key.
486
     * @throws PropelException Any exceptions caught during processing will be
487
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
488
     */
489
    public static function doInsert($criteria, ConnectionInterface $con = null)
490
    {
491
        if (null === $con) {
492
            $con = Propel::getServiceContainer()->getWriteConnection(BannerImageI18nTableMap::DATABASE_NAME);
0 ignored issues
show
Coding Style introduced by
As per coding style, self should be used for accessing local static members.

This check looks for accesses to local static members using the fully qualified name instead of self::.

<?php

class Certificate {
    const TRIPLEDES_CBC = 'ASDFGHJKL';

    private $key;

    public function __construct()
    {
        $this->key = Certificate::TRIPLEDES_CBC;
    }
}

While this is perfectly valid, the fully qualified name of Certificate::TRIPLEDES_CBC could just as well be replaced by self::TRIPLEDES_CBC. Referencing local members with self:: assured the access will still work when the class is renamed, makes it perfectly clear that the member is in fact local and will usually be shorter.

Loading history...
493
        }
494
495
        if ($criteria instanceof Criteria) {
0 ignored issues
show
Bug introduced by
The class Propel\Runtime\ActiveQuery\Criteria does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
496
            $criteria = clone $criteria; // rename for clarity
497
        } else {
498
            $criteria = $criteria->buildCriteria(); // build Criteria from BannerImageI18n object
499
        }
500
0 ignored issues
show
Coding Style introduced by
Functions must not contain multiple empty lines in a row; found 2 empty lines
Loading history...
501
502
        // Set the correct dbName
503
        $query = BannerImageI18nQuery::create()->mergeWith($criteria);
504
505
        // use transaction because $criteria could contain info
506
        // for more than one table (I guess, conceivably)
507
        return $con->transaction(function () use ($con, $query) {
508
            return $query->doInsert($con);
509
        });
510
    }
511
512
} // BannerImageI18nTableMap
513
// This is the static code needed to register the TableMap for this table with the main Propel class.
514
//
515
BannerImageI18nTableMap::buildTableMap();
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
516