Code Duplication    Length = 17-17 lines in 2 locations

src/services/ModelByHandle.php 1 location

@@ 237-253 (lines=17) @@
234
     * @param Record $record
235
     * @return BaseModel|ModelWithHandle|null
236
     */
237
    public function findCacheByRecord(Record $record)
238
    {
239
240
        if ($record instanceof RecordWithHandle) {
241
242
            // Check if already in cache by id
243
            if (!$this->isCachedByHandle($record->handle)) {
244
245
                return $this->findCacheByHandle($record->handle);
246
247
            }
248
249
        }
250
251
        return parent::findCacheByRecord($record);
252
253
    }
254
255
    /*******************************************
256
     * RECORD BY HANDLE

src/services/ObjectByHandle.php 1 location

@@ 229-245 (lines=17) @@
226
     * @param Record $record
227
     * @return BaseObject|ObjectWithHandle|null
228
     */
229
    public function findCacheByRecord(Record $record)
230
    {
231
232
        if ($record instanceof RecordWithHandle) {
233
234
            // Check if already in cache by id
235
            if (!$this->isCachedByHandle($record->handle)) {
236
237
                return $this->findCacheByHandle($record->handle);
238
239
            }
240
241
        }
242
243
        return parent::findCacheByRecord($record);
244
245
    }
246
247
    /*******************************************
248
     * RECORD BY HANDLE