Completed
Push — development ( 67765c...7029e6 )
by Andrij
18:12
created

RouteTableMap::clearRelatedInstancePool()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace core\models\Map;
4
5
use Map\SCategoryTableMap;
6
use Map\SProductsTableMap;
7
use Propel\Runtime\Propel;
8
use Propel\Runtime\ActiveQuery\Criteria;
9
use Propel\Runtime\ActiveQuery\InstancePoolTrait;
10
use Propel\Runtime\Connection\ConnectionInterface;
11
use Propel\Runtime\DataFetcher\DataFetcherInterface;
12
use Propel\Runtime\Exception\PropelException;
13
use Propel\Runtime\Map\RelationMap;
14
use Propel\Runtime\Map\TableMap;
15
use Propel\Runtime\Map\TableMapTrait;
16
use core\models\Route;
17
use core\models\RouteQuery;
18
19
20
/**
21
 * This class defines the structure of the 'route' table.
22
 *
23
 *
24
 *
25
 * 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...
26
 * For example, the createSelectSql() method checks the type of a given column used in an
27
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
28
 * (i.e. if it's a text column type).
29
 *
30
 */
0 ignored issues
show
introduced by
Additional blank lines found at end of doc comment
Loading history...
31
class RouteTableMap extends TableMap
32
{
0 ignored issues
show
introduced by
Opening brace of a class must be on the same line as the definition
Loading history...
33
    use InstancePoolTrait;
34
    use TableMapTrait;
35
36
    /**
37
     * The (dot-path) name of this class
38
     */
39
    const CLASS_NAME = 'core.models.Map.RouteTableMap';
40
41
    /**
42
     * The default database name for this class
43
     */
44
    const DATABASE_NAME = 'Shop';
45
46
    /**
47
     * The table name for this class
48
     */
49
    const TABLE_NAME = 'route';
50
51
    /**
52
     * The related Propel class for this table
53
     */
54
    const OM_CLASS = '\\core\\models\\Route';
55
56
    /**
57
     * A class that can be returned by this tableMap
58
     */
59
    const CLASS_DEFAULT = 'core.models.Route';
60
61
    /**
62
     * The total number of columns
63
     */
64
    const NUM_COLUMNS = 5;
65
66
    /**
67
     * The number of lazy-loaded columns
68
     */
69
    const NUM_LAZY_LOAD_COLUMNS = 0;
70
71
    /**
72
     * The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS)
73
     */
74
    const NUM_HYDRATE_COLUMNS = 5;
75
76
    /**
77
     * the column name for the id field
78
     */
79
    const COL_ID = 'route.id';
80
81
    /**
82
     * the column name for the entity_id field
83
     */
84
    const COL_ENTITY_ID = 'route.entity_id';
85
86
    /**
87
     * the column name for the type field
88
     */
89
    const COL_TYPE = 'route.type';
90
91
    /**
92
     * the column name for the parent_url field
93
     */
94
    const COL_PARENT_URL = 'route.parent_url';
95
96
    /**
97
     * the column name for the url field
98
     */
99
    const COL_URL = 'route.url';
100
101
    /**
102
     * The default string format for model objects of the related table
103
     */
104
    const DEFAULT_STRING_FORMAT = 'YAML';
105
106
    /**
107
     * holds an array of fieldnames
108
     *
109
     * 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...
110
     * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
111
     */
112
    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...
113
        self::TYPE_PHPNAME       => array('Id', 'EntityId', 'Type', 'ParentUrl', 'Url', ),
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...
114
        self::TYPE_CAMELNAME     => array('id', 'entityId', 'type', 'parentUrl', 'url', ),
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...
115
        self::TYPE_COLNAME       => array(RouteTableMap::COL_ID, RouteTableMap::COL_ENTITY_ID, RouteTableMap::COL_TYPE, RouteTableMap::COL_PARENT_URL, RouteTableMap::COL_URL, ),
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...
116
        self::TYPE_FIELDNAME     => array('id', 'entity_id', 'type', 'parent_url', 'url', ),
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_NUM           => array(0, 1, 2, 3, 4, )
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...
118
    );
119
120
    /**
121
     * holds an array of keys for quick access to the fieldnames array
122
     *
123
     * 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...
124
     * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0
125
     */
126
    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...
127
        self::TYPE_PHPNAME       => array('Id' => 0, 'EntityId' => 1, 'Type' => 2, 'ParentUrl' => 3, 'Url' => 4, ),
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...
128
        self::TYPE_CAMELNAME     => array('id' => 0, 'entityId' => 1, 'type' => 2, 'parentUrl' => 3, 'url' => 4, ),
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...
129
        self::TYPE_COLNAME       => array(RouteTableMap::COL_ID => 0, RouteTableMap::COL_ENTITY_ID => 1, RouteTableMap::COL_TYPE => 2, RouteTableMap::COL_PARENT_URL => 3, RouteTableMap::COL_URL => 4, ),
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...
130
        self::TYPE_FIELDNAME     => array('id' => 0, 'entity_id' => 1, 'type' => 2, 'parent_url' => 3, 'url' => 4, ),
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_NUM           => array(0, 1, 2, 3, 4, )
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...
132
    );
133
134
    /**
135
     * Initialize the table attributes and columns
136
     * Relations are not initialized by this method since they are lazy loaded
137
     *
138
     * @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...
139
     * @throws PropelException
0 ignored issues
show
introduced by
Comment missing or not on the next line for @throws tag in function comment
Loading history...
140
     */
141
    public function initialize()
142
    {
143
        // attributes
144
        $this->setName('route');
145
        $this->setPhpName('Route');
146
        $this->setIdentifierQuoting(false);
147
        $this->setClassName('\\core\\models\\Route');
148
        $this->setPackage('core.models');
149
        $this->setUseIdGenerator(true);
150
        // columns
151
        $this->addPrimaryKey('id', 'Id', 'INTEGER', true, 11, null);
152
        $this->addColumn('entity_id', 'EntityId', 'INTEGER', true, 11, null);
153
        $this->addColumn('type', 'Type', 'VARCHAR', true, 255, null);
154
        $this->addColumn('parent_url', 'ParentUrl', 'VARCHAR', false, 500, '');
155
        $this->addColumn('url', 'Url', 'VARCHAR', true, 255, null);
156
    } // initialize()
157
158
    /**
159
     * Build the RelationMap objects for this table relationships
160
     */
161 View Code Duplication
    public function buildRelations()
162
    {
163
        $this->addRelation('SCategory', '\\SCategory', RelationMap::ONE_TO_MANY, 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...
164
  0 =>
165
  array (
0 ignored issues
show
Coding Style introduced by
There must be no space between the "array" keyword and the opening parenthesis
Loading history...
166
    0 => ':route_id',
167
    1 => ':id',
168
  ),
169
), 'CASCADE', null, 'SCategories', 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...
170
        $this->addRelation('SProducts', '\\SProducts', RelationMap::ONE_TO_MANY, 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...
171
  0 =>
172
  array (
0 ignored issues
show
Coding Style introduced by
There must be no space between the "array" keyword and the opening parenthesis
Loading history...
173
    0 => ':route_id',
174
    1 => ':id',
175
  ),
176
), 'CASCADE', null, 'SProductss', 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...
177
    } // buildRelations()
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
178
    /**
179
     * Method to invalidate the instance pool of all tables related to route     * by a foreign key with ON DELETE CASCADE
180
     */
181
    public static function clearRelatedInstancePool()
182
    {
183
        // Invalidate objects in related instance pools,
184
        // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
185
        SCategoryTableMap::clearInstancePool();
186
        SProductsTableMap::clearInstancePool();
187
    }
188
189
    /**
190
     * 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.
191
     *
192
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
193
     * a multi-column primary key, a serialize()d version of the primary key will be returned.
194
     *
195
     * @param array  $row       resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
196
     * @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...
197
     * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
198
     *                           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...
199
     *
200
     * @return string The primary key hash of the row
201
     */
202 View Code Duplication
    public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
203
    {
204
        // If the PK cannot be derived from the row, return NULL.
205
        if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
206
            return null;
207
        }
208
209
        return 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)];
210
    }
211
212
    /**
213
     * Retrieves the primary key from the DB resultset row
214
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
215
     * a multi-column primary key, an array of the primary key columns will be returned.
216
     *
217
     * @param array  $row       resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
218
     * @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...
219
     * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
220
     *                           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...
221
     *
222
     * @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 integer.

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...
223
     */
224 View Code Duplication
    public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
225
    {
226
        return (int) $row[
0 ignored issues
show
Coding Style introduced by
Space found after square bracket; expected "[$indexType" but found "[
$indexType"
Loading history...
227
            $indexType == TableMap::TYPE_NUM
228
                ? 0 + $offset
229
                : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
230
        ];
0 ignored issues
show
Coding Style introduced by
Space found before square bracket; expected ")]" but found ")
]"
Loading history...
231
    }
232
233
    /**
234
     * The class that the tableMap will make instances of.
235
     *
236
     * If $withPrefix is true, the returned path
237
     * uses a dot-path notation which is translated into a path
238
     * relative to a location on the PHP include_path.
239
     * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
240
     *
241
     * @param boolean $withPrefix Whether or not to return the path with the class name
242
     * @return string path.to.ClassName
243
     */
244
    public static function getOMClass($withPrefix = true)
245
    {
246
        return $withPrefix ? RouteTableMap::CLASS_DEFAULT : RouteTableMap::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...
247
    }
248
249
    /**
250
     * Populates an object of the default type or an object that inherit from the default.
251
     *
252
     * @param array  $row       row returned by DataFetcher->fetch().
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
253
     * @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...
254
     * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
255
                                 One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
256
     *                           TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
257
     *
258
     * @throws PropelException Any exceptions caught during processing will be
259
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
260
     * @return array           (Route object, last column rank)
261
     */
262 View Code Duplication
    public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
263
    {
264
        $key = RouteTableMap::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...
265
        if (null !== ($obj = RouteTableMap::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...
266
            // We no longer rehydrate the object, since this can cause data loss.
267
            // See http://www.propelorm.org/ticket/509
268
            // $obj->hydrate($row, $offset, true); // rehydrate
269
            $col = $offset + RouteTableMap::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...
270
        } else {
271
            $cls = RouteTableMap::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...
272
            /** @var Route $obj */
273
            $obj = new $cls();
274
            $col = $obj->hydrate($row, $offset, false, $indexType);
275
            RouteTableMap::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...
276
        }
277
278
        return array($obj, $col);
279
    }
280
281
    /**
282
     * The returned array will contain objects of the default type or
283
     * objects that inherit from the default.
284
     *
285
     * @param DataFetcherInterface $dataFetcher
286
     * @return array
287
     * @throws PropelException Any exceptions caught during processing will be
288
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
289
     */
290 View Code Duplication
    public static function populateObjects(DataFetcherInterface $dataFetcher)
291
    {
292
        $results = array();
293
294
        // set the class once to avoid overhead in the loop
295
        $cls = static::getOMClass(false);
296
        // populate the object(s)
297
        while ($row = $dataFetcher->fetch()) {
298
            $key = RouteTableMap::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...
299
            if (null !== ($obj = RouteTableMap::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...
300
                // We no longer rehydrate the object, since this can cause data loss.
301
                // See http://www.propelorm.org/ticket/509
302
                // $obj->hydrate($row, 0, true); // rehydrate
303
                $results[] = $obj;
304
            } else {
305
                /** @var Route $obj */
306
                $obj = new $cls();
307
                $obj->hydrate($row);
308
                $results[] = $obj;
309
                RouteTableMap::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...
310
            } // if key exists
311
        }
312
313
        return $results;
314
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
315
    /**
316
     * Add all the columns needed to create a new object.
317
     *
318
     * Note: any columns that were marked with lazyLoad="true" in the
319
     * XML schema will not be added to the select list and only loaded
320
     * on demand.
321
     *
322
     * @param Criteria $criteria object containing the columns to add.
323
     * @param string   $alias    optional table alias
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 3 found
Loading history...
324
     * @throws PropelException Any exceptions caught during processing will be
325
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
326
     */
327
    public static function addSelectColumns(Criteria $criteria, $alias = null)
328
    {
329
        if (null === $alias) {
330
            $criteria->addSelectColumn(RouteTableMap::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...
331
            $criteria->addSelectColumn(RouteTableMap::COL_ENTITY_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...
332
            $criteria->addSelectColumn(RouteTableMap::COL_TYPE);
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...
333
            $criteria->addSelectColumn(RouteTableMap::COL_PARENT_URL);
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...
334
            $criteria->addSelectColumn(RouteTableMap::COL_URL);
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...
335
        } else {
336
            $criteria->addSelectColumn($alias . '.id');
337
            $criteria->addSelectColumn($alias . '.entity_id');
338
            $criteria->addSelectColumn($alias . '.type');
339
            $criteria->addSelectColumn($alias . '.parent_url');
340
            $criteria->addSelectColumn($alias . '.url');
341
        }
342
    }
343
344
    /**
345
     * Returns the TableMap related to this object.
346
     * This method is not needed for general use but a specific application could have a need.
347
     * @return TableMap
348
     * @throws PropelException Any exceptions caught during processing will be
349
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
350
     */
351
    public static function getTableMap()
352
    {
353
        return Propel::getServiceContainer()->getDatabaseMap(RouteTableMap::DATABASE_NAME)->getTable(RouteTableMap::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...
354
    }
355
356
    /**
357
     * Add a TableMap instance to the database for this tableMap class.
358
     */
359
    public static function buildTableMap()
360
    {
361
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(RouteTableMap::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...
362
        if (!$dbMap->hasTable(RouteTableMap::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...
363
            $dbMap->addTableObject(new RouteTableMap());
364
        }
365
    }
366
367
    /**
368
     * Performs a DELETE on the database, given a Route or Criteria object OR a primary key value.
369
     *
370
     * @param mixed               $values Criteria or Route 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...
371
     *              which is used to create the DELETE statement
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
372
     * @param  ConnectionInterface $con the connection to use
373
     * @return int             The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
374
     *                         if supported by native driver or if emulated using Propel.
375
     * @throws PropelException Any exceptions caught during processing will be
376
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
377
     */
378
     public static function doDelete($values, ConnectionInterface $con = null)
379
     {
380
        if (null === $con) {
381
            $con = Propel::getServiceContainer()->getWriteConnection(RouteTableMap::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...
382
        }
383
384
        if ($values instanceof Criteria) {
385
            // rename for clarity
386
            $criteria = $values;
387
        } elseif ($values instanceof \core\models\Route) { // it's a model object
0 ignored issues
show
introduced by
There should be no white space after an opening "{"
Loading history...
388
            // create criteria based on pk values
389
            $criteria = $values->buildPkeyCriteria();
390
        } 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...
391
            $criteria = new Criteria(RouteTableMap::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...
392
            $criteria->add(RouteTableMap::COL_ID, (array) $values, Criteria::IN);
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...
393
        }
394
395
        $query = RouteQuery::create()->mergeWith($criteria);
396
397
        if ($values instanceof Criteria) {
398
            RouteTableMap::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...
399
        } 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...
400
            foreach ((array) $values as $singleval) {
401
                RouteTableMap::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...
402
            }
403
        }
404
405
        return $query->delete($con);
406
    }
0 ignored issues
show
introduced by
Closing brace indented incorrectly; expected 5 spaces, found 4
Loading history...
407
408
    /**
409
     * Deletes all rows from the route table.
410
     *
411
     * @param ConnectionInterface $con the connection to use
412
     * @return int The number of affected rows (if supported by underlying database driver).
413
     */
414
    public static function doDeleteAll(ConnectionInterface $con = null)
415
    {
416
        return RouteQuery::create()->doDeleteAll($con);
417
    }
418
419
    /**
420
     * Performs an INSERT on the database, given a Route or Criteria object.
421
     *
422
     * @param mixed               $criteria Criteria or Route 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...
423
     * @param ConnectionInterface $con the ConnectionInterface connection to use
424
     * @return mixed           The new primary key.
425
     * @throws PropelException Any exceptions caught during processing will be
426
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
427
     */
428 View Code Duplication
    public static function doInsert($criteria, ConnectionInterface $con = null)
429
    {
430
        if (null === $con) {
431
            $con = Propel::getServiceContainer()->getWriteConnection(RouteTableMap::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...
432
        }
433
434
        if ($criteria instanceof Criteria) {
435
            $criteria = clone $criteria; // rename for clarity
436
        } else {
437
            $criteria = $criteria->buildCriteria(); // build Criteria from Route object
438
        }
439
440
        if ($criteria->containsKey(RouteTableMap::COL_ID) && $criteria->keyContainsValue(RouteTableMap::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...
introduced by
There should be no white space before a closing ")"
Loading history...
441
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.RouteTableMap::COL_ID.')');
0 ignored issues
show
introduced by
Concat operator must be surrounded by spaces
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...
442
        }
443
0 ignored issues
show
Coding Style introduced by
Functions must not contain multiple empty lines in a row; found 2 empty lines
Loading history...
444
445
        // Set the correct dbName
446
        $query = RouteQuery::create()->mergeWith($criteria);
447
448
        // use transaction because $criteria could contain info
449
        // for more than one table (I guess, conceivably)
450
        return $con->transaction(function () use ($con, $query) {
451
            return $query->doInsert($con);
452
        });
453
    }
454
455
} // RouteTableMap
456
// This is the static code needed to register the TableMap for this table with the main Propel class.
457
//
458
RouteTableMap::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...
459