Skip to content
Bastian Feder edited this page Dec 28, 2010 · 1 revision

Purpose

The article component manages articles to be prepared for writing into the Jackrabbit storage layer.

Synopsis

This class can be called in two ways.

Plain empty object

Instantiating it without any parameters it creates an empty object. Since every attribute is not accessible from the outside the only way to get data into the object is by using the convert() method.

`…

$article = new \Application\ImportBundle\Component\Article(); $article->convert(array $articleData, array $metaData);

…`

Article object

Passing a path to an article when instantiating the object tents to find the article in the Jackalope storage. To be able to do this it is necessary to pass an instance of the \Bundle\JackalopeBundle\Loader class along the path. Since the instance of the Jackalope loader is optional it can be missed, but an exception will be thrown in this case. Since this class is made for running in a Symfony 2 (SF2) environment usually the Jackalope instance will be provided by the calling class using the \Bundle\JackalopeBundle to from SF2 providing the instance. If the request article could not be found a proper exception will be thrown to clarify the problem.

`…

$article = new \Application\ImportBundle\Component\Article('\feeds\faz\books\Unique-ID_of_an_article', $jackalope);

…`

Clone this wiki locally