Code Duplication    Length = 27-27 lines in 2 locations

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.