Code Duplication    Length = 27-27 lines in 2 locations

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

@@ 141-167 (lines=27) @@
138
     *
139
     * @return ChildBannerImageI18n|array|mixed the result, formatted by the current formatter
140
     */
141
    public function findPk($key, ConnectionInterface $con = null)
142
    {
143
        if ($key === null) {
144
            return null;
145
        }
146
147
        if ($con === null) {
148
            $con = Propel::getServiceContainer()->getReadConnection(BannerImageI18nTableMap::DATABASE_NAME);
149
        }
150
151
        $this->basePreSelect($con);
152
153
        if (
154
            $this->formatter || $this->modelAlias || $this->with || $this->select
155
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
156
            || $this->map || $this->having || $this->joins
157
        ) {
158
            return $this->findPkComplex($key, $con);
159
        }
160
161
        if ((null !== ($obj = BannerImageI18nTableMap::getInstanceFromPool(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])]))))) {
162
            // the object is already in the instance pool
163
            return $obj;
164
        }
165
166
        return $this->findPkSimple($key, $con);
167
    }
168
169
    /**
170
     * Find object by primary key using raw SQL to go fast.

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

@@ 126-152 (lines=27) @@
123
     *
124
     * @return ChildBannersI18n|array|mixed the result, formatted by the current formatter
125
     */
126
    public function findPk($key, ConnectionInterface $con = null)
127
    {
128
        if ($key === null) {
129
            return null;
130
        }
131
132
        if ($con === null) {
133
            $con = Propel::getServiceContainer()->getReadConnection(BannersI18nTableMap::DATABASE_NAME);
134
        }
135
136
        $this->basePreSelect($con);
137
138
        if (
139
            $this->formatter || $this->modelAlias || $this->with || $this->select
140
            || $this->selectColumns || $this->asColumns || $this->selectModifiers
141
            || $this->map || $this->having || $this->joins
142
        ) {
143
            return $this->findPkComplex($key, $con);
144
        }
145
146
        if ((null !== ($obj = BannersI18nTableMap::getInstanceFromPool(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])]))))) {
147
            // the object is already in the instance pool
148
            return $obj;
149
        }
150
151
        return $this->findPkSimple($key, $con);
152
    }
153
154
    /**
155
     * Find object by primary key using raw SQL to go fast.