Code Duplication    Length = 35-35 lines in 2 locations

application/modules/xbanners/models/Base/BannerImageI18n.php 1 location

@@ 579-613 (lines=35) @@
576
     * @return int             next starting column
577
     * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
578
     */
579
    public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
580
    {
581
        try {
582
583
            $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : BannerImageI18nTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
584
            $this->id = (null !== $col) ? (int) $col : null;
585
586
            $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : BannerImageI18nTableMap::translateFieldName('Locale', TableMap::TYPE_PHPNAME, $indexType)];
587
            $this->locale = (null !== $col) ? (string) $col : null;
588
589
            $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : BannerImageI18nTableMap::translateFieldName('Src', TableMap::TYPE_PHPNAME, $indexType)];
590
            $this->src = (null !== $col) ? (string) $col : null;
591
592
            $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : BannerImageI18nTableMap::translateFieldName('Name', TableMap::TYPE_PHPNAME, $indexType)];
593
            $this->name = (null !== $col) ? (string) $col : null;
594
595
            $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : BannerImageI18nTableMap::translateFieldName('Clicks', TableMap::TYPE_PHPNAME, $indexType)];
596
            $this->clicks = (null !== $col) ? (int) $col : null;
597
598
            $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : BannerImageI18nTableMap::translateFieldName('Description', TableMap::TYPE_PHPNAME, $indexType)];
599
            $this->description = (null !== $col) ? (string) $col : null;
600
            $this->resetModified();
601
602
            $this->setNew(false);
603
604
            if ($rehydrate) {
605
                $this->ensureConsistency();
606
            }
607
608
            return $startcol + 6; // 6 = BannerImageI18nTableMap::NUM_HYDRATE_COLUMNS.
609
610
        } catch (Exception $e) {
611
            throw new PropelException(sprintf('Error populating %s object', '\\xbanners\\models\\BannerImageI18n'), 0, $e);
612
        }
613
    }
614
615
    /**
616
     * Checks and repairs the internal consistency of the object.

application/modules/xbanners/models/Base/Banners.php 1 location

@@ 596-630 (lines=35) @@
593
     * @return int             next starting column
594
     * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
595
     */
596
    public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
597
    {
598
        try {
599
600
            $col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : BannersTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
601
            $this->id = (null !== $col) ? (int) $col : null;
602
603
            $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : BannersTableMap::translateFieldName('Place', TableMap::TYPE_PHPNAME, $indexType)];
604
            $this->place = (null !== $col) ? (string) $col : null;
605
606
            $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : BannersTableMap::translateFieldName('Width', TableMap::TYPE_PHPNAME, $indexType)];
607
            $this->width = (null !== $col) ? (int) $col : null;
608
609
            $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : BannersTableMap::translateFieldName('Height', TableMap::TYPE_PHPNAME, $indexType)];
610
            $this->height = (null !== $col) ? (int) $col : null;
611
612
            $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : BannersTableMap::translateFieldName('Effects', TableMap::TYPE_PHPNAME, $indexType)];
613
            $this->effects = (null !== $col) ? (string) $col : null;
614
615
            $col = $row[TableMap::TYPE_NUM == $indexType ? 5 + $startcol : BannersTableMap::translateFieldName('PageType', TableMap::TYPE_PHPNAME, $indexType)];
616
            $this->page_type = (null !== $col) ? (string) $col : null;
617
            $this->resetModified();
618
619
            $this->setNew(false);
620
621
            if ($rehydrate) {
622
                $this->ensureConsistency();
623
            }
624
625
            return $startcol + 6; // 6 = BannersTableMap::NUM_HYDRATE_COLUMNS.
626
627
        } catch (Exception $e) {
628
            throw new PropelException(sprintf('Error populating %s object', '\\xbanners\\models\\Banners'), 0, $e);
629
        }
630
    }
631
632
    /**
633
     * Checks and repairs the internal consistency of the object.