Code Duplication    Length = 7-7 lines in 2 locations

class/contact.php 2 locations

@@ 331-337 (lines=7) @@
328
        if ($contacts) {
329
            $ret = array();
330
            /** @var Contact $root */
331
            foreach ($contacts as $root) {
332
                $tab                   = array();
333
                $tab                   = $root->toArray();
334
                $tab['contact_owner']  = XoopsUser::getUnameFromId($root->getVar('contact_uid'));
335
                $tab['contact_create'] = formatTimestamp($root->getVar('contact_create'), _MEDIUMDATESTRING);
336
                $ret []                = $tab;
337
            }
338
339
            return $ret;
340
        } else {
@@ 363-369 (lines=7) @@
360
        $contacts =& $this->getObjects($criteria, false);
361
        if ($contacts) {
362
            /** @var Contact $root */
363
            foreach ($contacts as $root) {
364
                $tab                   = array();
365
                $tab                   = $root->toArray();
366
                $tab['contact_owner']  = XoopsUser::getUnameFromId($root->getVar('contact_uid'));
367
                $tab['contact_create'] = formatTimestamp($root->getVar('contact_create'), _MEDIUMDATESTRING);
368
                $ret []                = $tab;
369
            }
370
        }
371
372
        return $ret;