Code Duplication    Length = 11-11 lines in 2 locations

src/query/Generic.php 1 location

@@ 270-280 (lines=11) @@
267
     *
268
     * @return \samsoncms\api\Entity First matching entity
269
     */
270
    public function first()
271
    {
272
        // Proxy to regular database query
273
        $return = $this->query
274
            ->entity(static::$identifier)
275
            ->limit(1)
276
            ->whereCondition($this->conditions)
277
            ->exec();
278
279
        return array_shift($return);
280
    }
281
282
    /**
283
     * Perform SamsonCMS query and get amount resulting entities.

src/query/Record.php 1 location

@@ 187-197 (lines=11) @@
184
     *
185
     * @return \samsoncms\api\Entity First matching entity
186
     */
187
    public function first()
188
    {
189
        // Proxy to regular database query
190
        $return = $this->query
191
            ->entity(static::$identifier)
192
            ->limit(1)
193
            ->whereCondition($this->conditions)
194
            ->exec();
195
196
        return array_shift($return);
197
    }
198
199
    /**
200
     * Perform SamsonCMS query and get amount resulting entities.