| @@ 113-139 (lines=27) @@ | ||
| 110 | * |
|
| 111 | * @return ChildTask|array|mixed the result, formatted by the current formatter |
|
| 112 | */ |
|
| 113 | public function findPk($key, ConnectionInterface $con = null) |
|
| 114 | { |
|
| 115 | if ($key === null) { |
|
| 116 | return null; |
|
| 117 | } |
|
| 118 | ||
| 119 | if ($con === null) { |
|
| 120 | $con = Propel::getServiceContainer()->getReadConnection(TaskTableMap::DATABASE_NAME); |
|
| 121 | } |
|
| 122 | ||
| 123 | $this->basePreSelect($con); |
|
| 124 | ||
| 125 | if ( |
|
| 126 | $this->formatter || $this->modelAlias || $this->with || $this->select |
|
| 127 | || $this->selectColumns || $this->asColumns || $this->selectModifiers |
|
| 128 | || $this->map || $this->having || $this->joins |
|
| 129 | ) { |
|
| 130 | return $this->findPkComplex($key, $con); |
|
| 131 | } |
|
| 132 | ||
| 133 | if ((null !== ($obj = TaskTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) { |
|
| 134 | // the object is already in the instance pool |
|
| 135 | return $obj; |
|
| 136 | } |
|
| 137 | ||
| 138 | return $this->findPkSimple($key, $con); |
|
| 139 | } |
|
| 140 | ||
| 141 | /** |
|
| 142 | * Find object by primary key using raw SQL to go fast. |
|
| @@ 133-159 (lines=27) @@ | ||
| 130 | * |
|
| 131 | * @return ChildUser|array|mixed the result, formatted by the current formatter |
|
| 132 | */ |
|
| 133 | public function findPk($key, ConnectionInterface $con = null) |
|
| 134 | { |
|
| 135 | if ($key === null) { |
|
| 136 | return null; |
|
| 137 | } |
|
| 138 | ||
| 139 | if ($con === null) { |
|
| 140 | $con = Propel::getServiceContainer()->getReadConnection(UserTableMap::DATABASE_NAME); |
|
| 141 | } |
|
| 142 | ||
| 143 | $this->basePreSelect($con); |
|
| 144 | ||
| 145 | if ( |
|
| 146 | $this->formatter || $this->modelAlias || $this->with || $this->select |
|
| 147 | || $this->selectColumns || $this->asColumns || $this->selectModifiers |
|
| 148 | || $this->map || $this->having || $this->joins |
|
| 149 | ) { |
|
| 150 | return $this->findPkComplex($key, $con); |
|
| 151 | } |
|
| 152 | ||
| 153 | if ((null !== ($obj = UserTableMap::getInstanceFromPool(null === $key || is_scalar($key) || is_callable([$key, '__toString']) ? (string) $key : $key)))) { |
|
| 154 | // the object is already in the instance pool |
|
| 155 | return $obj; |
|
| 156 | } |
|
| 157 | ||
| 158 | return $this->findPkSimple($key, $con); |
|
| 159 | } |
|
| 160 | ||
| 161 | /** |
|
| 162 | * Find object by primary key using raw SQL to go fast. |
|