コード例 #1
0
ファイル: Term.php プロジェクト: 3ev/wordpress-core
 /**
  * {@inheritDoc}
  */
 public function bootstrap(Application $app)
 {
     // Bind a term factory instance
     $app->bind('term_factory', function ($app) {
         return new Factory();
     });
     // Bind a term repository instance
     $app->bind('term_repo', function ($app) {
         return new TermRepository($app->fetch('taxonomy_factory'), $app->fetch('term_factory'));
     });
 }
コード例 #2
0
ファイル: Post.php プロジェクト: 3ev/wordpress-core
 /**
  * {@inheritDoc}
  */
 public function bootstrap(Application $app)
 {
     // Bind a post factory instance
     $app->bind('post_factory', function ($app) {
         $f = new Factory($app->fetch('author_factory'), $app->fetch('taxonomy_factory'), $app->fetch('field_factory'));
         // Register defaut post types
         return $f->register('post', 'Tev\\Post\\Model\\Post')->register('page', 'Tev\\Post\\Model\\Page')->register('attachment', 'Tev\\Post\\Model\\Attachment');
     });
     // Bind a post repository instance
     $app->bind('post_repo', function ($app) {
         return new PostRepository($app->fetch('post_factory'));
     });
 }
コード例 #3
0
ファイル: FieldFactory.php プロジェクト: 3ev/wordpress-core
 /**
  * {@inheritDoc}
  */
 public function bootstrap(Application $app)
 {
     $app->bind('field_factory', function ($app) {
         $factory = new Factory($app);
         // Register defaults
         return $factory->register('true_false', 'Tev\\Field\\Model\\BasicField')->register('page_link', 'Tev\\Field\\Model\\BasicField')->register('color_picker', 'Tev\\Field\\Model\\BasicField')->register('oembed', 'Tev\\Field\\Model\\BasicField')->register('text', 'Tev\\Field\\Model\\BasicField')->register('wysiwyg', 'Tev\\Field\\Model\\BasicField')->register('textarea', 'Tev\\Field\\Model\\BasicField')->register('url', 'Tev\\Field\\Model\\BasicField')->register('email', 'Tev\\Field\\Model\\BasicField')->register('date_picker', 'Tev\\Field\\Model\\DateField')->register('file', 'Tev\\Field\\Model\\FileField')->register('select', 'Tev\\Field\\Model\\SelectField')->register('checkbox', 'Tev\\Field\\Model\\SelectField')->register('radio', 'Tev\\Field\\Model\\SelectField')->register('google_map', 'Tev\\Field\\Model\\GoogleMapField')->register('image', 'Tev\\Field\\Model\\ImageField')->register('number', 'Tev\\Field\\Model\\NumberField')->register('post_object', function ($data, $app) {
             return new PostField($data, $app->fetch('post_factory'));
         })->register('relationship', function ($data, $app) {
             return new PostField($data, $app->fetch('post_factory'));
         })->register('taxonomy', function ($data, $app) {
             return new TaxonomyField($data, $app->fetch('taxonomy_factory'), $app->fetch('term_factory'));
         })->register('user', function ($data, $app) {
             return new AuthorField($data, $app->fetch('author_factory'));
         })->register('repeater', function ($data, $app) {
             return new RepeaterField($data, $app->fetch('field_factory'));
         })->register('flexible_content', function ($data, $app) {
             return new FlexibleContentField($data, $app->fetch('field_factory'));
         });
     });
 }
コード例 #4
0
ファイル: Util.php プロジェクト: 3ev/wordpress-core
 /**
  * {@inheritDoc}
  */
 public function bootstrap(Application $app)
 {
     $app->bind('template_extras', function ($app) {
         return new TemplateExtras($app->fetch('post_factory'));
     });
 }