mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-01 12:40:11 +02:00
added README.rst to FlyweightFactory
This commit is contained in:
@@ -12,12 +12,14 @@ class FlyweightFactory
|
||||
{
|
||||
/**
|
||||
* Associative store for flyweight objects
|
||||
*
|
||||
* @var Array
|
||||
*/
|
||||
private $pool = array();
|
||||
|
||||
/**
|
||||
* Magic getter
|
||||
*
|
||||
* @param string $name
|
||||
* @return Flyweight
|
||||
*/
|
||||
@@ -29,6 +31,9 @@ class FlyweightFactory
|
||||
return $this->pool[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function totalNumber()
|
||||
{
|
||||
return sizeof($this->pool);
|
||||
|
Reference in New Issue
Block a user