Completed
Push — development ( 227e3a...98bb7e )
by Andrij
14:37
created

PageLinkTableMap::doDeleteAll()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace mod_link\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 mod_link\models\PageLink;
15
use mod_link\models\PageLinkQuery;
16
17
18
/**
19
 * This class defines the structure of the 'page_link' 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 PageLinkTableMap 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 = 'mod_link.models.Map.PageLinkTableMap';
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 = 'page_link';
48
49
    /**
50
     * The related Propel class for this table
51
     */
52
    const OM_CLASS = '\\mod_link\\models\\PageLink';
53
54
    /**
55
     * A class that can be returned by this tableMap
56
     */
57
    const CLASS_DEFAULT = 'mod_link.models.PageLink';
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 = 'page_link.id';
78
79
    /**
80
     * the column name for the page_id field
81
     */
82
    const COL_PAGE_ID = 'page_link.page_id';
83
84
    /**
85
     * the column name for the active_from field
86
     */
87
    const COL_ACTIVE_FROM = 'page_link.active_from';
88
89
    /**
90
     * the column name for the active_to field
91
     */
92
    const COL_ACTIVE_TO = 'page_link.active_to';
93
94
    /**
95
     * the column name for the show_on field
96
     */
97
    const COL_SHOW_ON = 'page_link.show_on';
98
99
    /**
100
     * the column name for the permanent field
101
     */
102
    const COL_PERMANENT = 'page_link.permanent';
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', 'PageId', 'ActiveFrom', 'ActiveTo', 'ShowOn', 'Permanent', ),
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', 'pageId', 'activeFrom', 'activeTo', 'showOn', 'permanent', ),
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(PageLinkTableMap::COL_ID, PageLinkTableMap::COL_PAGE_ID, PageLinkTableMap::COL_ACTIVE_FROM, PageLinkTableMap::COL_ACTIVE_TO, PageLinkTableMap::COL_SHOW_ON, PageLinkTableMap::COL_PERMANENT, ),
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', 'page_id', 'active_from', 'active_to', 'show_on', 'permanent', ),
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, 'PageId' => 1, 'ActiveFrom' => 2, 'ActiveTo' => 3, 'ShowOn' => 4, 'Permanent' => 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, 'pageId' => 1, 'activeFrom' => 2, 'activeTo' => 3, 'showOn' => 4, 'permanent' => 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(PageLinkTableMap::COL_ID => 0, PageLinkTableMap::COL_PAGE_ID => 1, PageLinkTableMap::COL_ACTIVE_FROM => 2, PageLinkTableMap::COL_ACTIVE_TO => 3, PageLinkTableMap::COL_SHOW_ON => 4, PageLinkTableMap::COL_PERMANENT => 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, 'page_id' => 1, 'active_from' => 2, 'active_to' => 3, 'show_on' => 4, 'permanent' => 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('page_link');
148
        $this->setPhpName('PageLink');
149
        $this->setIdentifierQuoting(false);
150
        $this->setClassName('\\mod_link\\models\\PageLink');
151
        $this->setPackage('mod_link.models');
152
        $this->setUseIdGenerator(true);
153
        // columns
154
        $this->addPrimaryKey('id', 'Id', 'INTEGER', true, 11, null);
155
        $this->addColumn('page_id', 'PageId', 'INTEGER', false, 11, null);
156
        $this->addColumn('active_from', 'ActiveFrom', 'INTEGER', false, 11, null);
157
        $this->addColumn('active_to', 'ActiveTo', 'INTEGER', false, 11, null);
158
        $this->addColumn('show_on', 'ShowOn', 'BOOLEAN', false, 1, null);
159
        $this->addColumn('permanent', 'Permanent', 'BOOLEAN', false, 1, null);
160
    } // initialize()
161
162
    /**
163
     * Build the RelationMap objects for this table relationships
164
     */
165
    public function buildRelations()
166
    {
167
        $this->addRelation('PageLinkProduct', '\\mod_link\\models\\PageLinkProduct', 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...
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 => ':link_id',
171
    1 => ':id',
172
  ),
173
), null, null, 'PageLinkProducts', 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
     * 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.
178
     *
179
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
180
     * a multi-column primary key, a serialize()d version of the primary key will be returned.
181
     *
182
     * @param array  $row       resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
183
     * @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...
184
     * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
185
     *                           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...
186
     *
187
     * @return string The primary key hash of the row
188
     */
189 View Code Duplication
    public static function getPrimaryKeyHashFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
190
    {
191
        // If the PK cannot be derived from the row, return NULL.
192
        if ($row[TableMap::TYPE_NUM == $indexType ? 0 + $offset : static::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)] === null) {
193
            return null;
194
        }
195
196
        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)];
197
    }
198
199
    /**
200
     * Retrieves the primary key from the DB resultset row
201
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
202
     * a multi-column primary key, an array of the primary key columns will be returned.
203
     *
204
     * @param array  $row       resultset row.
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
205
     * @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...
206
     * @param string $indexType One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
207
     *                           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...
208
     *
209
     * @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...
210
     */
211 View Code Duplication
    public static function getPrimaryKeyFromRow($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
212
    {
213
        return (int) $row[
0 ignored issues
show
Coding Style introduced by
Space found after square bracket; expected "[$indexType" but found "[
$indexType"
Loading history...
214
            $indexType == TableMap::TYPE_NUM
215
                ? 0 + $offset
216
                : self::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)
217
        ];
0 ignored issues
show
Coding Style introduced by
Space found before square bracket; expected ")]" but found ")
]"
Loading history...
218
    }
219
220
    /**
221
     * The class that the tableMap will make instances of.
222
     *
223
     * If $withPrefix is true, the returned path
224
     * uses a dot-path notation which is translated into a path
225
     * relative to a location on the PHP include_path.
226
     * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
227
     *
228
     * @param boolean $withPrefix Whether or not to return the path with the class name
229
     * @return string path.to.ClassName
230
     */
231
    public static function getOMClass($withPrefix = true)
232
    {
233
        return $withPrefix ? PageLinkTableMap::CLASS_DEFAULT : PageLinkTableMap::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...
234
    }
235
236
    /**
237
     * Populates an object of the default type or an object that inherit from the default.
238
     *
239
     * @param array  $row       row returned by DataFetcher->fetch().
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 2 found
Loading history...
240
     * @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...
241
     * @param string $indexType The index type of $row. Mostly DataFetcher->getIndexType().
242
                                 One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME
243
     *                           TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
244
     *
245
     * @throws PropelException Any exceptions caught during processing will be
246
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
247
     * @return array           (PageLink object, last column rank)
248
     */
249
    public static function populateObject($row, $offset = 0, $indexType = TableMap::TYPE_NUM)
250
    {
251
        $key = PageLinkTableMap::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...
252
        if (null !== ($obj = PageLinkTableMap::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...
253
            // We no longer rehydrate the object, since this can cause data loss.
254
            // See http://www.propelorm.org/ticket/509
255
            // $obj->hydrate($row, $offset, true); // rehydrate
256
            $col = $offset + PageLinkTableMap::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...
257
        } else {
258
            $cls = PageLinkTableMap::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...
259
            /** @var PageLink $obj */
260
            $obj = new $cls();
261
            $col = $obj->hydrate($row, $offset, false, $indexType);
262
            PageLinkTableMap::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...
263
        }
264
265
        return array($obj, $col);
266
    }
267
268
    /**
269
     * The returned array will contain objects of the default type or
270
     * objects that inherit from the default.
271
     *
272
     * @param DataFetcherInterface $dataFetcher
273
     * @return array
274
     * @throws PropelException Any exceptions caught during processing will be
275
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
276
     */
277
    public static function populateObjects(DataFetcherInterface $dataFetcher)
278
    {
279
        $results = array();
280
281
        // set the class once to avoid overhead in the loop
282
        $cls = static::getOMClass(false);
283
        // populate the object(s)
284
        while ($row = $dataFetcher->fetch()) {
285
            $key = PageLinkTableMap::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...
286
            if (null !== ($obj = PageLinkTableMap::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...
287
                // We no longer rehydrate the object, since this can cause data loss.
288
                // See http://www.propelorm.org/ticket/509
289
                // $obj->hydrate($row, 0, true); // rehydrate
290
                $results[] = $obj;
291
            } else {
292
                /** @var PageLink $obj */
293
                $obj = new $cls();
294
                $obj->hydrate($row);
295
                $results[] = $obj;
296
                PageLinkTableMap::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...
297
            } // if key exists
298
        }
299
300
        return $results;
301
    }
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line after function; 0 found
Loading history...
302
    /**
303
     * Add all the columns needed to create a new object.
304
     *
305
     * Note: any columns that were marked with lazyLoad="true" in the
306
     * XML schema will not be added to the select list and only loaded
307
     * on demand.
308
     *
309
     * @param Criteria $criteria object containing the columns to add.
310
     * @param string   $alias    optional table alias
0 ignored issues
show
introduced by
Expected 1 spaces after parameter type; 3 found
Loading history...
311
     * @throws PropelException Any exceptions caught during processing will be
312
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
313
     */
314
    public static function addSelectColumns(Criteria $criteria, $alias = null)
315
    {
316
        if (null === $alias) {
317
            $criteria->addSelectColumn(PageLinkTableMap::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...
318
            $criteria->addSelectColumn(PageLinkTableMap::COL_PAGE_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...
319
            $criteria->addSelectColumn(PageLinkTableMap::COL_ACTIVE_FROM);
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...
320
            $criteria->addSelectColumn(PageLinkTableMap::COL_ACTIVE_TO);
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
            $criteria->addSelectColumn(PageLinkTableMap::COL_SHOW_ON);
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...
322
            $criteria->addSelectColumn(PageLinkTableMap::COL_PERMANENT);
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...
323
        } else {
324
            $criteria->addSelectColumn($alias . '.id');
325
            $criteria->addSelectColumn($alias . '.page_id');
326
            $criteria->addSelectColumn($alias . '.active_from');
327
            $criteria->addSelectColumn($alias . '.active_to');
328
            $criteria->addSelectColumn($alias . '.show_on');
329
            $criteria->addSelectColumn($alias . '.permanent');
330
        }
331
    }
332
333
    /**
334
     * Returns the TableMap related to this object.
335
     * This method is not needed for general use but a specific application could have a need.
336
     * @return TableMap
337
     * @throws PropelException Any exceptions caught during processing will be
338
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
339
     */
340
    public static function getTableMap()
341
    {
342
        return Propel::getServiceContainer()->getDatabaseMap(PageLinkTableMap::DATABASE_NAME)->getTable(PageLinkTableMap::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...
343
    }
344
345
    /**
346
     * Add a TableMap instance to the database for this tableMap class.
347
     */
348
    public static function buildTableMap()
349
    {
350
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(PageLinkTableMap::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...
351
        if (!$dbMap->hasTable(PageLinkTableMap::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...
352
            $dbMap->addTableObject(new PageLinkTableMap());
353
        }
354
    }
355
356
    /**
357
     * Performs a DELETE on the database, given a PageLink or Criteria object OR a primary key value.
358
     *
359
     * @param mixed               $values Criteria or PageLink 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...
360
     *              which is used to create the DELETE statement
0 ignored issues
show
introduced by
Parameter comment must end with a full stop
Loading history...
361
     * @param  ConnectionInterface $con the connection to use
362
     * @return int             The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
363
     *                         if supported by native driver or if emulated using Propel.
364
     * @throws PropelException Any exceptions caught during processing will be
365
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
366
     */
367
     public static function doDelete($values, ConnectionInterface $con = null)
368
     {
369
        if (null === $con) {
370
            $con = Propel::getServiceContainer()->getWriteConnection(PageLinkTableMap::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...
371
        }
372
373
        if ($values instanceof Criteria) {
374
            // rename for clarity
375
            $criteria = $values;
376
        } elseif ($values instanceof \mod_link\models\PageLink) { // it's a model object
0 ignored issues
show
introduced by
There should be no white space after an opening "{"
Loading history...
377
            // create criteria based on pk values
378
            $criteria = $values->buildPkeyCriteria();
379
        } 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...
380
            $criteria = new Criteria(PageLinkTableMap::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...
381
            $criteria->add(PageLinkTableMap::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...
382
        }
383
384
        $query = PageLinkQuery::create()->mergeWith($criteria);
385
386
        if ($values instanceof Criteria) {
387
            PageLinkTableMap::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...
388
        } 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...
389
            foreach ((array) $values as $singleval) {
390
                PageLinkTableMap::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...
391
            }
392
        }
393
394
        return $query->delete($con);
395
    }
0 ignored issues
show
introduced by
Closing brace indented incorrectly; expected 5 spaces, found 4
Loading history...
396
397
    /**
398
     * Deletes all rows from the page_link table.
399
     *
400
     * @param ConnectionInterface $con the connection to use
401
     * @return int The number of affected rows (if supported by underlying database driver).
402
     */
403
    public static function doDeleteAll(ConnectionInterface $con = null)
404
    {
405
        return PageLinkQuery::create()->doDeleteAll($con);
406
    }
407
408
    /**
409
     * Performs an INSERT on the database, given a PageLink or Criteria object.
410
     *
411
     * @param mixed               $criteria Criteria or PageLink 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...
412
     * @param ConnectionInterface $con the ConnectionInterface connection to use
413
     * @return mixed           The new primary key.
414
     * @throws PropelException Any exceptions caught during processing will be
415
     *                         rethrown wrapped into a PropelException.
0 ignored issues
show
introduced by
@throws tag comment must start with a capital letter
Loading history...
416
     */
417 View Code Duplication
    public static function doInsert($criteria, ConnectionInterface $con = null)
418
    {
419
        if (null === $con) {
420
            $con = Propel::getServiceContainer()->getWriteConnection(PageLinkTableMap::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...
421
        }
422
423
        if ($criteria instanceof Criteria) {
424
            $criteria = clone $criteria; // rename for clarity
425
        } else {
426
            $criteria = $criteria->buildCriteria(); // build Criteria from PageLink object
427
        }
428
429
        if ($criteria->containsKey(PageLinkTableMap::COL_ID) && $criteria->keyContainsValue(PageLinkTableMap::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...
430
            throw new PropelException('Cannot insert a value for auto-increment primary key ('.PageLinkTableMap::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...
431
        }
432
0 ignored issues
show
Coding Style introduced by
Functions must not contain multiple empty lines in a row; found 2 empty lines
Loading history...
433
434
        // Set the correct dbName
435
        $query = PageLinkQuery::create()->mergeWith($criteria);
436
437
        // use transaction because $criteria could contain info
438
        // for more than one table (I guess, conceivably)
439
        return $con->transaction(function () use ($con, $query) {
440
            return $query->doInsert($con);
441
        });
442
    }
443
444
} // PageLinkTableMap
445
// This is the static code needed to register the TableMap for this table with the main Propel class.
446
//
447
PageLinkTableMap::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...
448