예제 #1
0
 /**
  * Initializing the object with its parsed value.
  *
  * Value is iterated and its values (and keys)
  * are getting contained by the object.
  *
  * @param array $value Value
  */
 public function __construct(array $value = null)
 {
     $this->value = array();
     if (!isset($value)) {
         return;
     }
     if (Bencode\Builder::isDictionary($value)) {
         foreach ($value as $key => $sub_value) {
             $this->contain($sub_value, new StringValue($key));
         }
     } else {
         foreach ($value as $sub_value) {
             $this->contain($sub_value);
         }
     }
 }