PHP 클래스 Ouzo\Utilities\Suppliers

파일 보기 프로젝트 열기: letsdrink/ouzo 1 사용 예제들

공개 메소드들

메소드 설명
memoize ( callable $function ) : Ouzo\Utilities\Supplier\Supplier Returns a supplier which caches the callback result and returns that value on subsequent calls to get().
memoizeWithExpiration ( callable $function, integer $expireTime = 3600 ) : Ouzo\Utilities\Supplier\Supplier Returns a supplier which caches the callback result and removes the cached value after specified time.

메소드 상세

memoize() 공개 정적인 메소드

Returns a supplier which caches the callback result and returns that value on subsequent calls to get().
public static memoize ( callable $function ) : Ouzo\Utilities\Supplier\Supplier
$function callable
리턴 Ouzo\Utilities\Supplier\Supplier

memoizeWithExpiration() 공개 정적인 메소드

Subsequent calls to get() return the cached value if expiration time has not passed. Time is passed in seconds.
public static memoizeWithExpiration ( callable $function, integer $expireTime = 3600 ) : Ouzo\Utilities\Supplier\Supplier
$function callable
$expireTime integer
리턴 Ouzo\Utilities\Supplier\Supplier