Code Duplication    Length = 27-27 lines in 3 locations

application/modules/mod_link/models/Base/PageLinkQuery.php 1 location

@@ 141-167 (lines=27) @@
138
     *
139
     * @return ChildPageLink|array|mixed the result, formatted by the current formatter
140
     */
141
    public function findPk($key, ConnectionInterface $con = null)
142
    {
143
        if ($key === null) {
144
            return null;
145
        }
146
147
        if ($con === null) {
148
            $con = Propel::getServiceContainer()->getReadConnection(PageLinkTableMap::DATABASE_NAME);
149
        }
150
151
        $this->basePreSelect($con);
152
153
        if (
154
            $this->formatter || $this->modelAlias || $this->with || $this->select
155
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
156
            || $this->map || $this->having || $this->joins
157
        ) {
158
            return $this->findPkComplex($key, $con);
159
        }
160
161
        if ((null !== ($obj = PageLinkTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {
162
            // the object is already in the instance pool
163
            return $obj;
164
        }
165
166
        return $this->findPkSimple($key, $con);
167
    }
168
169
    /**
170
     * Find object by primary key using raw SQL to go fast.

application/modules/xbanners/models/Base/BannerImageQuery.php 1 location

@@ 173-199 (lines=27) @@
170
     *
171
     * @return ChildBannerImage|array|mixed the result, formatted by the current formatter
172
     */
173
    public function findPk($key, ConnectionInterface $con = null)
174
    {
175
        if ($key === null) {
176
            return null;
177
        }
178
179
        if ($con === null) {
180
            $con = Propel::getServiceContainer()->getReadConnection(BannerImageTableMap::DATABASE_NAME);
181
        }
182
183
        $this->basePreSelect($con);
184
185
        if (
186
            $this->formatter || $this->modelAlias || $this->with || $this->select
187
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
188
            || $this->map || $this->having || $this->joins
189
        ) {
190
            return $this->findPkComplex($key, $con);
191
        }
192
193
        if ((null !== ($obj = BannerImageTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {
194
            // the object is already in the instance pool
195
            return $obj;
196
        }
197
198
        return $this->findPkSimple($key, $con);
199
    }
200
201
    /**
202
     * Find object by primary key using raw SQL to go fast.

application/modules/xbanners/models/Base/BannersQuery.php 1 location

@@ 154-180 (lines=27) @@
151
     *
152
     * @return ChildBanners|array|mixed the result, formatted by the current formatter
153
     */
154
    public function findPk($key, ConnectionInterface $con = null)
155
    {
156
        if ($key === null) {
157
            return null;
158
        }
159
160
        if ($con === null) {
161
            $con = Propel::getServiceContainer()->getReadConnection(BannersTableMap::DATABASE_NAME);
162
        }
163
164
        $this->basePreSelect($con);
165
166
        if (
167
            $this->formatter || $this->modelAlias || $this->with || $this->select
168
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
169
            || $this->map || $this->having || $this->joins
170
        ) {
171
            return $this->findPkComplex($key, $con);
172
        }
173
174
        if ((null !== ($obj = BannersTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) {
175
            // the object is already in the instance pool
176
            return $obj;
177
        }
178
179
        return $this->findPkSimple($key, $con);
180
    }
181
182
    /**
183
     * Find object by primary key using raw SQL to go fast.