2017 © Pedro Peláez
 

library phpcr-generator

Fixture generastor for PHPCR

image

dantleech/phpcr-generator

Fixture generastor for PHPCR

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHPCR Node Generator

, (*1)

Small library for generating node data for benchmarking, testing, etc., (*2)

Example

Basic

    $converter = new NodeConverter($phpcrSession);
    $builder = new NodeBuilder('node', 'nt:unstructured');

    $builder->node('content', 'nt:unstructured')
            ->node('article1')
                ->property('title', 'My first article')
                ->property('body', 'My first article body')
            ->end()
            ->node('article2')
                ->property('title', 'My first article')
                ->property('body', 'My first article body')
            ->end()
        ->end();

    $this->converter->convert($this->builder);

    $phpcrSession->save();

Will result in:, (*3)

node/
    article1/ 
        - title: My First Article
        - body: My First Article body
    article2/
        - title: My First Article
        - body: My First Article body

Ranges

You can also specify ranges in the node name:, (*4)

        $builder->node('content-[1-5]', 'nt:unstructured')
            ->node('article[1-10]')
                ->property('title', 'My first article')
                ->property('body', 'My first article body')
            ->end()
        ->end();

Will result in 50 nodes being created., (*5)

The Versions

16/10 2014

dev-master

9999999-dev

Fixture generastor for PHPCR

  Sources   Download

The Requires

  • phpcr/phpcr-implementation ~2.1.0

 

The Development Requires

16/10 2014

0.1

0.1.0.0

Fixture generastor for PHPCR

  Sources   Download

The Requires

  • phpcr/phpcr-implementation ~2.1.0

 

The Development Requires