1<?php
2/**
3 * File containing the ezcBaseFileFindContext class.
4 *
5 * @package Base
6 * @version 1.8
7 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
8 * @license http://ez.no/licenses/new_bsd New BSD License
9 */
10
11/**
12 * Struct which defines the information collected by the file walker for locating files.
13 *
14 * @package Base
15 * @version 1.8
16 */
17class ezcBaseFileFindContext extends ezcBaseStruct
18{
19    /**
20     * The list of files
21     *
22     * @var array(string)
23     */
24    public $elements;
25
26    /**
27     * The number of files
28     *
29     * @var int
30     */
31    public $count;
32
33    /**
34     * The total file size of all files found
35     *
36     * @var int
37     */
38    public $size;
39
40    /**
41     * Constructs a new ezcBaseFileFindContext with initial values.
42     *
43     * @param array(string) $elements
44     * @param int $count
45     * @param int $size
46     */
47    public function __construct( $elements = array(), $count = 0, $size = 0 )
48    {
49        $this->elements = $elements;
50        $this->count = $count;
51        $this->size = $size;
52    }
53
54    /**
55     * Returns a new instance of this class with the data specified by $array.
56     *
57     * $array contains all the data members of this class in the form:
58     * array('member_name'=>value).
59     *
60     * __set_state makes this class exportable with var_export.
61     * var_export() generates code, that calls this method when it
62     * is parsed with PHP.
63     *
64     * @param array(string=>mixed) $array
65     * @return ezcBaseFileFindContext
66     */
67    static public function __set_state( array $array )
68    {
69        return new ezcBaseFileFindContext( $array['elements'], $array['count'], $array['size'] );
70    }
71}
72?>
73