Blame view

lib/ObjectCreator.php 570 Bytes
8e128526   Mihail   add xlsx parser
1
2
3
4
5
6
7
8
  <?php
  /**
   * Created by PhpStorm.
   * User: Tsurkanov
   * Date: 20.10.2015
   * Time: 16:24
   */
  
d0261fd1   Mihail   fixed namespace i...
9
  namespace yii\multiparser;
8e128526   Mihail   add xlsx parser
10
11
  
  
8e128526   Mihail   add xlsx parser
12
13
14
15
16
17
  class ObjectCreator {
      public static function build( array $configuration ){
          if ( isset( $configuration['class'] ) ) {
              $class =  trim( $configuration['class'] );
              unset( $configuration['class'] );
          } else{
b46a9c6c   Mihail   add examples for ...
18
              return null;
8e128526   Mihail   add xlsx parser
19
20
21
22
23
24
25
26
27
28
          }
  
          $object = new $class();
          foreach ($configuration as $name => $value) {
              $object->$name = $value;
          }
  
          return $object;
      }
  }