Skip to content

Commit 0da93ce

Browse files
author
Samuel Akopyan
committed
Created CCollection class
1 parent 0e9762a commit 0da93ce

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

framework/collections/CCollection.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* CCollect provides a wrapper for working with arrays of data
4+
*
5+
* @project ApPHP Framework
6+
* @author ApPHP <[email protected]>
7+
* @link http://www.apphpframework.com/
8+
* @copyright Copyright (c) 2012 - 2020 ApPHP Framework
9+
* @license http://www.apphpframework.com/license/
10+
*
11+
* PUBLIC: PROTECTED: PRIVATE:
12+
* ---------- ---------- ----------
13+
* __construct
14+
*
15+
* init (static)
16+
* all
17+
*
18+
*/
19+
20+
class CCollection extends CComponent
21+
{
22+
23+
/**
24+
* The items contained in the collection
25+
* @var array
26+
*/
27+
protected $_items = [];
28+
29+
/**
30+
* Class default constructor
31+
*/
32+
function __construct()
33+
{
34+
35+
}
36+
37+
/**
38+
* Returns the instance of object
39+
* @return current class
40+
*/
41+
public static function init()
42+
{
43+
return parent::init(__CLASS__);
44+
}
45+
46+
/**
47+
* Get all of the items in the collection
48+
*
49+
* @return array
50+
*/
51+
public function all()
52+
{
53+
return $this->_items;
54+
}
55+
56+
}

0 commit comments

Comments
 (0)