فهرست منبع

[1.11] Updated interface

- Updated to include hasFeature() and getFeature() methods.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23156 44c647ce-9c0f-0410-b52a-842ac1e357ba
matthew 15 سال پیش
والد
کامیت
9103abc067
2فایلهای تغییر یافته به همراه53 افزوده شده و 0 حذف شده
  1. 37 0
      documentation/manual/en/module_specs/Zend_Http_UserAgent-Device.xml
  2. 16 0
      library/Zend/Http/UserAgent/Device.php

+ 37 - 0
documentation/manual/en/module_specs/Zend_Http_UserAgent-Device.xml

@@ -192,6 +192,43 @@ interface Zend_Http_UserAgent_Device extends Serializable
                 </listitem>
             </varlistentry>
 
+            <varlistentry id="zend.http.user-agent-device.methods.has-feature">
+                <term>
+                    <methodsynopsis>
+                        <methodname>hasFeature</methodname>
+                        <methodparam>
+                            <funcparams>$feature</funcparams>
+                        </methodparam>
+                    </methodsynopsis>
+                </term>
+
+                <listitem>
+                    <para>
+                        Query the device to determine if it contains information on a specific
+                        feature.
+                    </para>
+                </listitem>
+            </varlistentry>
+
+            <varlistentry id="zend.http.user-agent-device.methods.get-feature">
+                <term>
+                    <methodsynopsis>
+                        <methodname>getFeature</methodname>
+                        <methodparam>
+                            <funcparams>$feature</funcparams>
+                        </methodparam>
+                    </methodsynopsis>
+                </term>
+
+                <listitem>
+                    <para>
+                        Retrieve the value of a specific device feature, if present. Typically, this
+                        will return a boolean <constant>false</constant> or a
+                        <constant>null</constant> value if the feature is not defined.
+                    </para>
+                </listitem>
+            </varlistentry>
+
             <varlistentry id="zend.http.user-agent-device.methods.get-browser">
                 <term>
                     <methodsynopsis>

+ 16 - 0
library/Zend/Http/UserAgent/Device.php

@@ -70,6 +70,22 @@ interface Zend_Http_UserAgent_Device extends Serializable
     public function getAllGroups();
 
     /**
+     * Whether or not the device has a given feature
+     * 
+     * @param  string $feature 
+     * @return bool
+     */
+    public function hasFeature($feature);
+
+    /**
+     * Get the value of a specific device feature
+     * 
+     * @param  string $feature 
+     * @return mixed
+     */
+    public function getFeature($feature);
+
+    /**
      * Get the browser type
      * 
      * @return string