PHP code example of ramsondon / arraycollectionfactory

1. Go to this page and download the library: Download ramsondon/arraycollectionfactory library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ramsondon / arraycollectionfactory example snippets


    use Ramsondon\ArrayCollectionFactory;

    $factroy = new ArrayCollectionFactory();

    /* @var $collection \Ramsondon\TypedArray\Cache\ITestObjectArrayCollection */
    $collection = $factory->create('Class\\Of\\TestObject');

    $object = new Class\Of\TestObject();

    $collection->append($object);

    /* @var $testobject \Class\Of\TestObject */
    foreach ($collection as $testobject) {
        $testobject->doSomething();
    }