php-daddy/contract-multiton

Multiton Contract or Interface

dev-master / 1.1.x-dev 2015-03-15 01:09 UTC

This package is not auto-updated.

Last update: 2024-11-09 18:26:56 UTC


README

Build Status

Requirements

Installation

$ composer require "php-daddy/contract-multiton":"*"

Usage

<?php

use PhpDaddy\Contract\Multiton\AbstractMultiton;

class MultitonStub extends AbstractMultiton
{

}

$obj = MultitonStub::getInstance('yourkeyhere');

or

<?php

use PhpDaddy\Contract\Multiton\Multiton;
use PhpDaddy\Contract\Multiton\MultitonTrait;

class MultitonStub implements Multiton
{
    use MultitonTrait;
}

$obj = MultitonStub::getInstance('your_key_here');
$obj = MultitonStub::getInstance('your_another_key_here');