Code Duplication    Length = 27-27 lines in 2 locations

src/eXpansion/Bundle/LocalRecords/Model/Base/RecordQuery.php 1 location

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

src/eXpansion/Framework/PlayersBundle/Model/Base/PlayerQuery.php 1 location

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