| @@ 207-227 (lines=21) @@ | ||
| 204 | * |
|
| 205 | * @param mixed $value A \xbanners\models\BannerImageI18n object or a primary key value. |
|
| 206 | */ |
|
| 207 | public static function removeInstanceFromPool($value) |
|
| 208 | { |
|
| 209 | if (Propel::isInstancePoolingEnabled() && null !== $value) { |
|
| 210 | if (is_object($value) && $value instanceof \xbanners\models\BannerImageI18n) { |
|
| 211 | $key = serialize([(null === $value->getId() || is_scalar($value->getId()) || is_callable([$value->getId(), '__toString']) ? (string) $value->getId() : $value->getId()), (null === $value->getLocale() || is_scalar($value->getLocale()) || is_callable([$value->getLocale(), '__toString']) ? (string) $value->getLocale() : $value->getLocale())]); |
|
| 212 | ||
| 213 | } elseif (is_array($value) && count($value) === 2) { |
|
| 214 | // assume we've been passed a primary key"; |
|
| 215 | $key = serialize([(null === $value[0] || is_scalar($value[0]) || is_callable([$value[0], '__toString']) ? (string) $value[0] : $value[0]), (null === $value[1] || is_scalar($value[1]) || is_callable([$value[1], '__toString']) ? (string) $value[1] : $value[1])]); |
|
| 216 | } elseif ($value instanceof Criteria) { |
|
| 217 | self::$instances = []; |
|
| 218 | ||
| 219 | return; |
|
| 220 | } else { |
|
| 221 | $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \xbanners\models\BannerImageI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true))); |
|
| 222 | throw $e; |
|
| 223 | } |
|
| 224 | ||
| 225 | unset(self::$instances[$key]); |
|
| 226 | } |
|
| 227 | } |
|
| 228 | ||
| 229 | /** |
|
| 230 | * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. |
|
| @@ 189-209 (lines=21) @@ | ||
| 186 | * |
|
| 187 | * @param mixed $value A \xbanners\models\BannersI18n object or a primary key value. |
|
| 188 | */ |
|
| 189 | public static function removeInstanceFromPool($value) |
|
| 190 | { |
|
| 191 | if (Propel::isInstancePoolingEnabled() && null !== $value) { |
|
| 192 | if (is_object($value) && $value instanceof \xbanners\models\BannersI18n) { |
|
| 193 | $key = serialize([(null === $value->getId() || is_scalar($value->getId()) || is_callable([$value->getId(), '__toString']) ? (string) $value->getId() : $value->getId()), (null === $value->getLocale() || is_scalar($value->getLocale()) || is_callable([$value->getLocale(), '__toString']) ? (string) $value->getLocale() : $value->getLocale())]); |
|
| 194 | ||
| 195 | } elseif (is_array($value) && count($value) === 2) { |
|
| 196 | // assume we've been passed a primary key"; |
|
| 197 | $key = serialize([(null === $value[0] || is_scalar($value[0]) || is_callable([$value[0], '__toString']) ? (string) $value[0] : $value[0]), (null === $value[1] || is_scalar($value[1]) || is_callable([$value[1], '__toString']) ? (string) $value[1] : $value[1])]); |
|
| 198 | } elseif ($value instanceof Criteria) { |
|
| 199 | self::$instances = []; |
|
| 200 | ||
| 201 | return; |
|
| 202 | } else { |
|
| 203 | $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or \xbanners\models\BannersI18n object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value, true))); |
|
| 204 | throw $e; |
|
| 205 | } |
|
| 206 | ||
| 207 | unset(self::$instances[$key]); |
|
| 208 | } |
|
| 209 | } |
|
| 210 | ||
| 211 | /** |
|
| 212 | * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table. |
|