private static function putPartnerInCache($obj, $by_id = true, $pk = null) { // if there is no partner - cache for a short while assuming we are in the middle of creating one // if there is a partner - cache for a little longer assuming it doesn't change very much once it's created //$expiry = ( $obj != null ? 600 : 60 ); if ($obj == null) { $cache = new myObjectCache(self::EXPIRY_FOR_NULL); if ($by_id) { $cache->putValue(self::CLZZ, $pk, null, self::NULL_PARTNER); } else { $cache->putValue(self::CLZZ, $pk, "partnerAlias", self::NULL_PARTNER); } } else { $cache = new myObjectCache(self::EXPIRY_FOR_NON_NULL); if ($by_id) { $cache->put($obj); } else { $cache->put($obj, "partnerAlias"); } } }