Code Duplication    Length = 23-23 lines in 2 locations

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

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

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

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