atelierspierrot/patterns

View on GitHub
phpdoc/Patterns/Abstracts/AbstractAccessible.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="robots" content="index, follow, all" />
    <title>Patterns\Abstracts\AbstractAccessible | Patterns</title>

            <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="../../css/sami.css">
        <script src="../../js/jquery-1.11.1.min.js"></script>
        <script src="../../js/bootstrap.min.js"></script>
        <script src="../../js/typeahead.min.js"></script>
        <script src="../../sami.js"></script>
        <meta name="MobileOptimized" content="width">
        <meta name="HandheldFriendly" content="true">
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    
    
    </head>

    <body id="class" data-name="class:Patterns_Abstracts_AbstractAccessible" data-root-path="../../">
            <div id="content">
        <div id="left-column">
                <div id="control-panel">
                <form id="search-form" action="../../search.html" method="GET">
            <span class="glyphicon glyphicon-search"></span>
            <input name="search"
                   class="typeahead form-control"
                   type="search"
                   placeholder="Search">
        </form>
    </div>

                <div id="api-tree"></div>

        </div>
        <div id="right-column">
                <nav id="site-nav" class="navbar navbar-default" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-elements">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="../../index.html">Patterns</a>
            </div>
            <div class="collapse navbar-collapse" id="navbar-elements">
                <ul class="nav navbar-nav">
                    <li><a href="../../classes.html">Classes</a></li>
                                            <li><a href="../../namespaces.html">Namespaces</a></li>
                                        <li><a href="../../interfaces.html">Interfaces</a></li>
                    <li><a href="../../traits.html">Traits</a></li>
                    <li><a href="../../doc-index.html">Index</a></li>
                    <li><a href="../../search.html">Search</a></li>
                </ul>
            </div>
        </div>
    </nav>

                        <div class="namespace-breadcrumbs">
            <ol class="breadcrumb">
                <li><span class="label label-default">class</span></li>
                                                            <li><a href="../../Patterns.html">Patterns</a></li>
                                        <li><a href="../../Patterns/Abstracts.html">Abstracts</a></li>
    
                <li>AbstractAccessible</li>
            </ol>
        </div>
                <div id="page-content">
                
    <div class="page-header">
        <h1>AbstractAccessible</h1>
    </div>

    <p>    class
    <strong>AbstractAccessible</strong>        implements
        <a href="../../Patterns/Interfaces/AccessibleInterface.html"><abbr title="Patterns\Interfaces\AccessibleInterface">AccessibleInterface</abbr></a>
</p>

            <div class="description">
            <p>Magic properties accessors</p>            <p>This abstract class defines commons magic methods to directly access (set, unset, check or get)
object properties. For more information about these PHP magic methods, please see in the PHP
manual :
<a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members</a>.</p>

<p>The four magic methods are:</p>

<ul>
<li><code>__set</code>, called when you write <code>$obj-&gt;property = value</code></li>
<li><code>__get</code>, called when you write <code>$obj-&gt;property</code></li>
<li><code>__isset</code>, called when you write <code>isset($obj-&gt;property)</code> or <code>empty($obj-&gt;property)</code></li>
<li><code>__unset</code>, called when you write <code>unset($obj-&gt;property)</code></li>
</ul>

<p>For each of these methods, the property invoked MUST exist in the object, which means it must
be declared in its definition or already set before the magic method call. If the property can't
be found, a <code>RuntimeException</code> will be thrown.</p>

<p>The class will first try to execute a method called like the accessor for the property (i.e.
method <code>getProperty</code> for the <code>__get</code> call of the variable <code>property</code>). This way, you can define
a method for accessing one of an object properties with a specific work on it, or let the class
use the default accessor feature.</p>

<p>NOTE - This class is abstract but does not declare any abstract method which should be described
in the child class ; you can use it easily by extending it.</p>        </div>
    
    
    
    
            <h2>Methods</h2>

            <div class="container-fluid underlined">
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Interfaces/AccessibleInterface.html"><abbr title="Patterns\Interfaces\AccessibleInterface">AccessibleInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method___set">__set</a>(
    string $var, 
    string $val)
                                            <p>Set an object property, accessing it by "setVariable" if the method exists</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    mixed
                </div>
                <div class="col-md-8 type">
                    <a href="#method___get">__get</a>(
    string $var)
                                            <p>Get an object property, accessing it by "getVariable" if the method exists</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    bool
                </div>
                <div class="col-md-8 type">
                    <a href="#method___isset">__isset</a>(
    string $var)
                                            <p>Test if an object property has been set, using the "issetVariable" method if defined</p>                </div>
                <div class="col-md-2"></div>
            </div>
                    <div class="row">
                <div class="col-md-2 type">
                    
    <a href="../../Patterns/Interfaces/AccessibleInterface.html"><abbr title="Patterns\Interfaces\AccessibleInterface">AccessibleInterface</abbr></a>
                </div>
                <div class="col-md-8 type">
                    <a href="#method___unset">__unset</a>(
    string $var)
                                            <p>Test if an object property has been set, using the "unsetVariable" method if defined</p>                </div>
                <div class="col-md-2"></div>
            </div>
            </div>


        <h2>Details</h2>

            <div id="method-details">
                    <div class="method-item">
                    <h3 id="method___set">
        <div class="location">at line 101</div>
        <code>                    
    <a href="../../Patterns/Interfaces/AccessibleInterface.html"><abbr title="Patterns\Interfaces\AccessibleInterface">AccessibleInterface</abbr></a>
    <strong>__set</strong>(
    string $var, 
    string $val)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Set an object property, accessing it by "setVariable" if the method exists</p>                    <p>Called when you write <code>$obj-&gt;property = value</code></p>            </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$var</td>
                <td>The property object to set</td>
            </tr>
                    <tr>
                <td>
    string</td>
                <td>$val</td>
                <td>The property value to set</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Interfaces/AccessibleInterface.html"><abbr title="Patterns\Interfaces\AccessibleInterface">AccessibleInterface</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/RuntimeException"><abbr title="RuntimeException">RuntimeException</abbr></a></td>
                <td>if the property doesn't exist in the object</td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method___get">
        <div class="location">at line 126</div>
        <code>                    
    mixed
    <strong>__get</strong>(
    string $var)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Get an object property, accessing it by "getVariable" if the method exists</p>                    <p>Called when you write <code>$obj-&gt;property</code></p>            </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$var</td>
                <td>The property object to get</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    mixed</td>
            <td>Returns the result of the "getVariable" method, of the property otherwise</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/RuntimeException"><abbr title="RuntimeException">RuntimeException</abbr></a></td>
                <td>if the property doesn't exist in the object</td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method___isset">
        <div class="location">at line 150</div>
        <code>                    
    bool
    <strong>__isset</strong>(
    string $var)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Test if an object property has been set, using the "issetVariable" method if defined</p>                    <p>Called when you write <code>isset($obj-&gt;property)</code> or <code>empty($obj-&gt;property)</code></p>            </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$var</td>
                <td>The property object to test</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    bool</td>
            <td>True if the property is already set</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/RuntimeException"><abbr title="RuntimeException">RuntimeException</abbr></a></td>
                <td>if the property doesn't exist in the object</td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
                    <div class="method-item">
                    <h3 id="method___unset">
        <div class="location">at line 174</div>
        <code>                    
    <a href="../../Patterns/Interfaces/AccessibleInterface.html"><abbr title="Patterns\Interfaces\AccessibleInterface">AccessibleInterface</abbr></a>
    <strong>__unset</strong>(
    string $var)</code>
    </h3>
    <div class="details">
                    <div class="method-description">
                                    <p>Test if an object property has been set, using the "unsetVariable" method if defined</p>                    <p>Called when you write <code>unset($obj-&gt;property)</code></p>            </div>
                <div class="tags">
                            <h4>Parameters</h4>

                    <table class="table table-condensed">
                    <tr>
                <td>
    string</td>
                <td>$var</td>
                <td>The property object to unset</td>
            </tr>
            </table>

            
                            <h4>Return Value</h4>

                    <table class="table table-condensed">
        <tr>
            <td>
    <a href="../../Patterns/Interfaces/AccessibleInterface.html"><abbr title="Patterns\Interfaces\AccessibleInterface">AccessibleInterface</abbr></a></td>
            <td>
</td>
        </tr>
    </table>

            
                            <h4>Exceptions</h4>

                    <table class="table table-condensed">
                    <tr>
                <td><a target="_blank" href="http://php.net/RuntimeException"><abbr title="RuntimeException">RuntimeException</abbr></a></td>
                <td>if the property doesn't exist in the object</td>
            </tr>
            </table>

            
                    </div>
    </div>

            </div>
            </div>

    
            </div>
                <div id="footer">
        Generated by <a href="http://sami.sensiolabs.org/">Sami, the API Documentation Generator</a>.
    </div>

        </div>
    </div>
    </body>

</html>