blob: 6e43d428b3d8b647e5da249cd13aecd6035fecfc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
<?php
/**
* TCache and cache dependency classes.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
* @copyright Copyright © 2005-2014 PradoSoft
* @license http://www.pradosoft.com/license/
* @package Prado\Caching
*/
namespace Prado\Caching;
/**
* TCacheDependencyList class.
*
* TCacheDependencyList represents a list of cache dependency objects.
* Only objects implementing {@link ICacheDependency} can be added into this list.
*
* TCacheDependencyList can be used like an array. See {@link TList}
* for more details.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @package Prado\Caching
* @since 3.1.0
*/
class TCacheDependencyList extends TList
{
/**
* Inserts an item at the specified position.
* This overrides the parent implementation by performing additional type checking
* for each newly added item.
* @param integer the specified position.
* @param mixed new item
* @throws TInvalidDataTypeException if the item to be inserted is not a dependency instance
*/
public function insertAt($index,$item)
{
if($item instanceof ICacheDependency)
parent::insertAt($index,$item);
else
throw new TInvalidDataTypeException('cachedependencylist_cachedependency_required');
}
}
|