Пример #1
0
 /**
  * @param  Builder $builder
  * @param  array   $options
  * @return mixed
  */
 public function build(Builder $builder, array $options = array())
 {
     $builder->name('document')->factory(function () {
         return new Document();
     })->node('name', 'text')->property('name')->end()->node('description', 'text')->property('description')->end()->node('rank', 'number')->property('rank')->end()->node('rating', 'number', array('decimals' => 2))->property('rating')->end();
     $this->addParentNode($builder);
 }
Пример #2
0
 /**
  * @param  Builder $builder
  * @param  array   $options
  * @return mixed
  */
 public function build(Builder $builder, array $options = array())
 {
     $prototype = $builder->name($options['name'])->prototype($options['item_type'], $options['item_options']);
     if ($options['item_name']) {
         $prototype->name($options['item_name']);
     }
 }
Пример #3
0
 /**
  * @param  Builder $builder
  * @param  array   $options
  * @return mixed
  */
 public function build(Builder $builder, array $options = array())
 {
     $builder->name('attributes')->keys('code', '[code]')->prototype()->factory(function () {
         return array();
     })->name('attribute')->property('[value]')->end();
 }
Пример #4
0
 /**
  * @param  Builder $builder
  * @param  array   $options
  * @return mixed
  */
 public function build(Builder $builder, array $options = array())
 {
     $builder->name('documents')->prototype('document')->name('document')->end();
 }