Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 174-196 (lines=23) @@
171
     *
172
     * @return ChildBannerImageI18n A model object, or null if the key is not found
173
     */
174
    protected function findPkSimple($key, ConnectionInterface $con)
175
    {
176
        $sql = 'SELECT id, locale, src, name, clicks, description FROM banner_image_i18n WHERE id = :p0 AND locale = :p1';
177
        try {
178
            $stmt = $con->prepare($sql);
179
            $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
180
            $stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
181
            $stmt->execute();
182
        } catch (Exception $e) {
183
            Propel::log($e->getMessage(), Propel::LOG_ERR);
184
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
185
        }
186
        $obj = null;
187
        if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
188
            /** @var ChildBannerImageI18n $obj */
189
            $obj = new ChildBannerImageI18n();
190
            $obj->hydrate($row);
191
            BannerImageI18nTableMap::addInstanceToPool($obj, serialize([(null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0]), (null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1])]));
192
        }
193
        $stmt->closeCursor();
194
195
        return $obj;
196
    }
197
198
    /**
199
     * Find object by primary key.

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

@@ 159-181 (lines=23) @@
156
     *
157
     * @return ChildBannersI18n A model object, or null if the key is not found
158
     */
159
    protected function findPkSimple($key, ConnectionInterface $con)
160
    {
161
        $sql = 'SELECT id, locale, name FROM banners_i18n WHERE id = :p0 AND locale = :p1';
162
        try {
163
            $stmt = $con->prepare($sql);
164
            $stmt->bindValue(':p0', $key[0], PDO::PARAM_INT);
165
            $stmt->bindValue(':p1', $key[1], PDO::PARAM_STR);
166
            $stmt->execute();
167
        } catch (Exception $e) {
168
            Propel::log($e->getMessage(), Propel::LOG_ERR);
169
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
170
        }
171
        $obj = null;
172
        if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
173
            /** @var ChildBannersI18n $obj */
174
            $obj = new ChildBannersI18n();
175
            $obj->hydrate($row);
176
            BannersI18nTableMap::addInstanceToPool($obj, serialize([(null === $key[0] || is_scalar($key[0]) || is_callable([$key[0], '__toString']) ? (string) $key[0] : $key[0]), (null === $key[1] || is_scalar($key[1]) || is_callable([$key[1], '__toString']) ? (string) $key[1] : $key[1])]));
177
        }
178
        $stmt->closeCursor();
179
180
        return $obj;
181
    }
182
183
    /**
184
     * Find object by primary key.