| @@ 173-193 (lines=21) @@ | ||
| 170 | * |
|
| 171 | * @return ChildBannerImage|array|mixed the result, formatted by the current formatter |
|
| 172 | */ |
|
| 173 | public function findPk($key, ConnectionInterface $con = null) |
|
| 174 | { |
|
| 175 | if ($key === null) { |
|
| 176 | return null; |
|
| 177 | } |
|
| 178 | if ((null !== ($obj = BannerImageTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) { |
|
| 179 | // the object is already in the instance pool |
|
| 180 | return $obj; |
|
| 181 | } |
|
| 182 | if ($con === null) { |
|
| 183 | $con = Propel::getServiceContainer()->getReadConnection(BannerImageTableMap::DATABASE_NAME); |
|
| 184 | } |
|
| 185 | $this->basePreSelect($con); |
|
| 186 | if ($this->formatter || $this->modelAlias || $this->with || $this->select |
|
| 187 | || $this->selectColumns || $this->asColumns || $this->selectModifiers |
|
| 188 | || $this->map || $this->having || $this->joins) { |
|
| 189 | return $this->findPkComplex($key, $con); |
|
| 190 | } else { |
|
| 191 | return $this->findPkSimple($key, $con); |
|
| 192 | } |
|
| 193 | } |
|
| 194 | ||
| 195 | /** |
|
| 196 | * Find object by primary key using raw SQL to go fast. |
|
| @@ 154-174 (lines=21) @@ | ||
| 151 | * |
|
| 152 | * @return ChildBanners|array|mixed the result, formatted by the current formatter |
|
| 153 | */ |
|
| 154 | public function findPk($key, ConnectionInterface $con = null) |
|
| 155 | { |
|
| 156 | if ($key === null) { |
|
| 157 | return null; |
|
| 158 | } |
|
| 159 | if ((null !== ($obj = BannersTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key))) && !$this->formatter) { |
|
| 160 | // the object is already in the instance pool |
|
| 161 | return $obj; |
|
| 162 | } |
|
| 163 | if ($con === null) { |
|
| 164 | $con = Propel::getServiceContainer()->getReadConnection(BannersTableMap::DATABASE_NAME); |
|
| 165 | } |
|
| 166 | $this->basePreSelect($con); |
|
| 167 | if ($this->formatter || $this->modelAlias || $this->with || $this->select |
|
| 168 | || $this->selectColumns || $this->asColumns || $this->selectModifiers |
|
| 169 | || $this->map || $this->having || $this->joins) { |
|
| 170 | return $this->findPkComplex($key, $con); |
|
| 171 | } else { |
|
| 172 | return $this->findPkSimple($key, $con); |
|
| 173 | } |
|
| 174 | } |
|
| 175 | ||
| 176 | /** |
|
| 177 | * Find object by primary key using raw SQL to go fast. |
|