Code Duplication    Length = 21-21 lines in 5 locations

src/cli/Database/Base/ChannelQuery.php 1 location

@@ 136-156 (lines=21) @@
133
     *
134
     * @return ChildChannel|array|mixed the result, formatted by the current formatter
135
     */
136
    public function findPk($key, ConnectionInterface $con = null)
137
    {
138
        if ($key === null) {
139
            return null;
140
        }
141
        if ((null !== ($obj = ChannelTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) {
142
            // the object is already in the instance pool
143
            return $obj;
144
        }
145
        if ($con === null) {
146
            $con = Propel::getServiceContainer()->getReadConnection(ChannelTableMap::DATABASE_NAME);
147
        }
148
        $this->basePreSelect($con);
149
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
150
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
151
         || $this->map || $this->having || $this->joins) {
152
            return $this->findPkComplex($key, $con);
153
        } else {
154
            return $this->findPkSimple($key, $con);
155
        }
156
    }
157
158
    /**
159
     * Find object by primary key using raw SQL to go fast.

src/cli/Database/Base/ConnectionQuery.php 1 location

@@ 151-171 (lines=21) @@
148
     *
149
     * @return ChildConnection|array|mixed the result, formatted by the current formatter
150
     */
151
    public function findPk($key, ConnectionInterface $con = null)
152
    {
153
        if ($key === null) {
154
            return null;
155
        }
156
        if ((null !== ($obj = ConnectionTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) {
157
            // the object is already in the instance pool
158
            return $obj;
159
        }
160
        if ($con === null) {
161
            $con = Propel::getServiceContainer()->getReadConnection(ConnectionTableMap::DATABASE_NAME);
162
        }
163
        $this->basePreSelect($con);
164
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
165
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
166
         || $this->map || $this->having || $this->joins) {
167
            return $this->findPkComplex($key, $con);
168
        } else {
169
            return $this->findPkSimple($key, $con);
170
        }
171
    }
172
173
    /**
174
     * Find object by primary key using raw SQL to go fast.

src/cli/Database/Base/InstanceQuery.php 1 location

@@ 146-166 (lines=21) @@
143
     *
144
     * @return ChildInstance|array|mixed the result, formatted by the current formatter
145
     */
146
    public function findPk($key, ConnectionInterface $con = null)
147
    {
148
        if ($key === null) {
149
            return null;
150
        }
151
        if ((null !== ($obj = InstanceTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) {
152
            // the object is already in the instance pool
153
            return $obj;
154
        }
155
        if ($con === null) {
156
            $con = Propel::getServiceContainer()->getReadConnection(InstanceTableMap::DATABASE_NAME);
157
        }
158
        $this->basePreSelect($con);
159
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
160
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
161
         || $this->map || $this->having || $this->joins) {
162
            return $this->findPkComplex($key, $con);
163
        } else {
164
            return $this->findPkSimple($key, $con);
165
        }
166
    }
167
168
    /**
169
     * Find object by primary key using raw SQL to go fast.

src/cli/Database/Base/SubscriptionQuery.php 1 location

@@ 176-196 (lines=21) @@
173
     *
174
     * @return ChildSubscription|array|mixed the result, formatted by the current formatter
175
     */
176
    public function findPk($key, ConnectionInterface $con = null)
177
    {
178
        if ($key === null) {
179
            return null;
180
        }
181
        if ((null !== ($obj = SubscriptionTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) {
182
            // the object is already in the instance pool
183
            return $obj;
184
        }
185
        if ($con === null) {
186
            $con = Propel::getServiceContainer()->getReadConnection(SubscriptionTableMap::DATABASE_NAME);
187
        }
188
        $this->basePreSelect($con);
189
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
190
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
191
         || $this->map || $this->having || $this->joins) {
192
            return $this->findPkComplex($key, $con);
193
        } else {
194
            return $this->findPkSimple($key, $con);
195
        }
196
    }
197
198
    /**
199
     * Find object by primary key using raw SQL to go fast.

src/cli/Database/Base/UserQuery.php 1 location

@@ 146-166 (lines=21) @@
143
     *
144
     * @return ChildUser|array|mixed the result, formatted by the current formatter
145
     */
146
    public function findPk($key, ConnectionInterface $con = null)
147
    {
148
        if ($key === null) {
149
            return null;
150
        }
151
        if ((null !== ($obj = UserTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) {
152
            // the object is already in the instance pool
153
            return $obj;
154
        }
155
        if ($con === null) {
156
            $con = Propel::getServiceContainer()->getReadConnection(UserTableMap::DATABASE_NAME);
157
        }
158
        $this->basePreSelect($con);
159
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
160
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
161
         || $this->map || $this->having || $this->joins) {
162
            return $this->findPkComplex($key, $con);
163
        } else {
164
            return $this->findPkSimple($key, $con);
165
        }
166
    }
167
168
    /**
169
     * Find object by primary key using raw SQL to go fast.