<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect2 id="zend.application.core-functionality.bootstrap-bootstrapabstract">
    <title>Zend_Application_Bootstrap_BootstrapAbstract</title>

    <para>
        <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname> is an abstract class
        which provides the base functionality of a common bootstrap. It implements
        both <link linkend="zend.application.core-functionality.bootstrap-bootstrapper">
            <classname>Zend_Application_Bootstrap_Bootstrapper</classname></link> and <link
            linkend="zend.application.core-functionality.bootstrap-resourcebootstrapper">
            <classname>Zend_Application_Bootstrap_ResourceBootstrapper</classname></link>.
    </para>

    <table id="zend.application.core-functionality.bootstrap-bootstrapabstract.api.table">
        <title>Zend_Application_Bootstrap_BootstrapAbstract Methods</title>

        <tgroup cols="4">
            <thead>
                <row>
                    <entry>Method</entry>
                    <entry>Return Value</entry>
                    <entry>Parameters</entry>
                    <entry>Description</entry>
                </row>
            </thead>

            <tbody>
                <row>
                    <entry><methodname>__construct($application)</methodname></entry>
                    <entry><type>Void</type></entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$application</varname>: <emphasis>required</emphasis>.
                                    Accepts either a <classname>Zend_Application</classname> or a
                                    <classname>Zend_Application_Bootstrap_Bootstrapper</classname>
                                    object as the sole argument.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            Constructor. Accepts a single argument, which should be a
                            <classname>Zend_Application</classname> object, or another bootstrap
                            object.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>setOptions(array $options)</methodname></entry>
                    <entry><classname>Zend_Application_Bootstrap_Bootstrapper</classname></entry>
                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$options</varname>: <emphasis>required</emphasis>.
                                    Array of options to set.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            Any option that has a matching setter will
                            invoke that setter; otherwise, the option will simply be
                            stored for later retrieval. As an example, if your
                            extending class defined a <methodname>setFoo()</methodname> method,
                            the option 'foo' would pass the value to that method.
                        </para>

                        <para>
                            Two additional, special options keys may also be used.
                            <property>pluginPaths</property> may be used to specify prefix
                            paths to plugin resources; it should be an array of
                            class prefix to filesystem path pairs.
                            <property>resources</property> may be used to specify plugin
                            resources to use, and should consist of plugin
                            resource to instantiation options pairs.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>getOptions()</methodname></entry>
                    <entry><type>Array</type></entry>
                    <entry>N/A</entry>
                    <entry>
                        <para>
                            Returns all options registered via
                            <methodname>setOptions()</methodname>.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>hasOption($key)</methodname></entry>
                    <entry><type>Boolean</type></entry>
                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$key</varname>: <emphasis>required</emphasis>.
                                    Option key to test.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry><para>Determine if an option key is present.</para></entry>
                </row>

                <row>
                    <entry><methodname>getOption($key)</methodname></entry>
                    <entry><type>Mixed</type></entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$key</varname>: <emphasis>required</emphasis>.
                                    Option key to retrieve.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            Retrieve the value associated with an option key; returns
                            <constant>NULL</constant> if no option is registered with that key.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry>
                        <methodname>setApplication(Zend_Application |
                            Zend_Application_Bootstrap_Bootstrapper $application)</methodname>
                    </entry>

                    <entry>
                        <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname>
                    </entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$application</varname>: <emphasis>required</emphasis>.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry><para>Register the parent application or bootstrap object.</para></entry>
                </row>

                <row>
                    <entry><methodname>getApplication()</methodname></entry>

                    <entry>
                        <classname>Zend_Application</classname> |
                        <classname>Zend_Application_Bootstrap_Bootstrapper</classname>
                    </entry>

                    <entry>N/A</entry>

                    <entry>
                        <para>
                            Retrieve the application or bootstrap object passed via the constructor.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>getEnvironment()</methodname></entry>
                    <entry><type>String</type></entry>
                    <entry>N/A</entry>

                    <entry>
                        <para>
                            Retrieve the environment string registered with the
                            parent application or bootstrap object.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>getClassResources()</methodname></entry>
                    <entry><type>Array</type></entry>
                    <entry>N/A</entry>

                    <entry>
                        <para>
                            Retrieve a list of available resource initializer names
                            as defined in the class. This may be implementation
                            specific.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>getContainer()</methodname></entry>
                    <entry><type>Object</type></entry>
                    <entry>N/A</entry>

                    <entry>
                        <para>
                            Retrieves the container that stores resources. If no
                            container is currently registered, it registers a <link
                                linkend="zend.registry">Zend_Registry</link>
                            instance before returning it.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>setContainer($container)</methodname></entry>

                    <entry>
                        <classname>Zend_Application_Bootstrap_BootstrapAbstract</classname>
                    </entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$container</varname>, <emphasis>required</emphasis>.
                                    An object in which to store resources.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            Provide a container in which to store resources. When a
                            resource method or plugin returns a value, it will be
                            stored in this container for later retrieval.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>hasResource($name)</methodname></entry>
                    <entry><type>Boolean</type></entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$name</varname>, <emphasis>required</emphasis>.
                                    Name of a resource to check.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            When a resource method or plugin returns a value, it
                            will be stored in the resource container (see
                            <methodname>getContainer()</methodname> and
                            <methodname>setContainer()</methodname>. This method will indicate
                            whether or not a value for that resource has been set.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>getResource($name)</methodname></entry>
                    <entry><type>Mixed</type></entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$name</varname>, <emphasis>required</emphasis>.
                                    Name of a resource to fetch.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            When a resource method or plugin returns a value, it
                            will be stored in the resource container (see
                            <methodname>getContainer()</methodname> and
                            <methodname>setContainer()</methodname>. This method will retrieve a
                            resources from the container.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>bootstrap($resource = null)</methodname></entry>
                    <entry><type>Mixed</type></entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$resource</varname>: <emphasis>optional</emphasis>.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            If <varname>$resource</varname> is empty, execute all
                            bootstrap resources. If a string, execute that single
                            resource; if an array, execute each resource in the array.
                        </para>

                        <para>
                            This method can be used to run individual bootstraps
                            either defined in the class itself or via resource
                            plugin classes. A resource defined in the class will be
                            run in preference over a resource plugin in the case of
                            naming conflicts.
                        </para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>run()</methodname></entry>
                    <entry><type>Void</type></entry>
                    <entry>N/A</entry>

                    <entry>
                        <para> Defines what application logic to run after bootstrapping.</para>
                    </entry>
                </row>

                <row>
                    <entry><methodname>__call($method, $args)</methodname></entry>
                    <entry><type>Mixed</type></entry>

                    <entry>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <varname>$method</varname>: <emphasis>required</emphasis>.
                                    The method name to call.
                                </para>
                            </listitem>

                            <listitem>
                                <para>
                                    <varname>$args</varname>: <emphasis>required</emphasis>.
                                    Array of arguments to use in the method call.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </entry>

                    <entry>
                        <para>
                            Provides convenience to bootstrapping individual
                            resources by allowing you to call
                            'bootstrap&lt;ResourceName&gt;()' instead of using the
                            <methodname>bootstrap()</methodname> method.
                        </para>
                    </entry>
                </row>
            </tbody>
        </tgroup>
    </table>
</sect2>
