@@ 187-195 (lines=9) @@ | ||
184 | * @param \xbanners\models\BannerImageI18n $obj A \xbanners\models\BannerImageI18n object. |
|
185 | * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). |
|
186 | */ |
|
187 | public static function addInstanceToPool($obj, $key = null) |
|
188 | { |
|
189 | if (Propel::isInstancePoolingEnabled()) { |
|
190 | if (null === $key) { |
|
191 | $key = serialize([(null === $obj->getId() || is_scalar($obj->getId()) || is_callable([$obj->getId(), '__toString']) ? (string) $obj->getId() : $obj->getId()), (null === $obj->getLocale() || is_scalar($obj->getLocale()) || is_callable([$obj->getLocale(), '__toString']) ? (string) $obj->getLocale() : $obj->getLocale())]); |
|
192 | } // if key === null |
|
193 | self::$instances[$key] = $obj; |
|
194 | } |
|
195 | } |
|
196 | ||
197 | /** |
|
198 | * Removes an object from the instance pool. |
@@ 169-177 (lines=9) @@ | ||
166 | * @param \xbanners\models\BannersI18n $obj A \xbanners\models\BannersI18n object. |
|
167 | * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). |
|
168 | */ |
|
169 | public static function addInstanceToPool($obj, $key = null) |
|
170 | { |
|
171 | if (Propel::isInstancePoolingEnabled()) { |
|
172 | if (null === $key) { |
|
173 | $key = serialize([(null === $obj->getId() || is_scalar($obj->getId()) || is_callable([$obj->getId(), '__toString']) ? (string) $obj->getId() : $obj->getId()), (null === $obj->getLocale() || is_scalar($obj->getLocale()) || is_callable([$obj->getLocale(), '__toString']) ? (string) $obj->getLocale() : $obj->getLocale())]); |
|
174 | } // if key === null |
|
175 | self::$instances[$key] = $obj; |
|
176 | } |
|
177 | } |
|
178 | ||
179 | /** |
|
180 | * Removes an object from the instance pool. |