博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
yii2框架随笔19
阅读量:4677 次
发布时间:2019-06-09

本文共 2320 字,大约阅读时间需要 7 分钟。

public function canGetProperty($name, $checkVars = true)    {        // property_exists — 检查对象或类是否具有该属性        return method_exists($this, 'get' . $name) || $checkVars && property_exists($this, $name);    }    /**     * Returns a value indicating whether a property can be set.     * 返回一个值指示是否可以设置一个属性。     * A property is writable if:        *     * - the class has a setter method associated with the specified name     *   (in this case, property name is case-insensitive);     * - the class has a member variable with the specified name (when `$checkVars` is true);     *     * 检查对象或类是否能够设置 $name 属性,如果 $checkVars 为 true,则不局限于是否有 setter     *     * @param string $name the property name     * @param boolean $checkVars whether to treat member variables as properties     * @return boolean whether the property can be written     * @see canGetProperty()     */    public function canSetProperty($name, $checkVars = true)    {        return method_exists($this, 'set' . $name) || $checkVars && property_exists($this, $name);//检查对象或类是否能够设置 $name 属性,返回Boolean值。    }    /**     * Returns a value indicating whether a method is defined.     * 返回一个值指示是否定义了一个方法。     * The default implementation is a call to php function `method_exists()`.     * You may override this method when you implemented the php magic method `__call()`.     *     * 检查对象或类是否具有 $name 方法     *     * @param string $name the method name     * @return boolean whether the method is defined     */    public function hasMethod($name)    {        return method_exists($this, $name);//返回Boolean值。    }    }

下面来介绍console/Controller.php

[--param1=value1 --param2 ...] * ~~~ * * * @property string $help This property is read-only. * @property string $helpSummary This property is read-only. * * @author Qiang Xue
* @since 2.0 */class Controller extends \yii\base\Controller{ const EXIT_CODE_NORMAL = 0; const EXIT_CODE_ERROR = 1; /** * @var boolean whether to run the command interactively. * 是否运行该命令交互 */ public $interactive = true; /** * @var boolean whether to enable ANSI color in the output. * 是否支持ANSI颜色在输出 * If not set, ANSI color will only be enabled for terminals that support it. * 如果没有设置,ANSI颜色只会支持终端支持它。 */ public $color;

 

转载于:https://www.cnblogs.com/taokai/p/5451188.html

你可能感兴趣的文章
用户代理字符串识别工具源码与slf4j日志使用
查看>>
算法导论第6部分图算法,第22章图的基本算法
查看>>
提示框第三方库之MBProgressHUD
查看>>
C语言 10-字符和字符串常用处理函数
查看>>
C++ 表达式语句 海伦的故事
查看>>
32位汇编学习笔记(1)
查看>>
day_01
查看>>
2013年12月日本語能力試験N3聴解部分
查看>>
uva 1349(拆点+最小费用流)
查看>>
关于SessionFactory的不同实现类分别通过getCurrentSession()方法 和 openSession() 方法获取的Session对象在保存对象时的一些区别...
查看>>
Web开发细节搜集
查看>>
织梦kindeditor图片上传增加图片说明alt属性和title属性
查看>>
HTML fieldset标签
查看>>
Popover view and Modal view
查看>>
linux 块操作 分类: ubuntu pytho...
查看>>
数字通信与数据通信有什么区别
查看>>
[TJOI 2016&HEOI 2016]排序
查看>>
HDU 1242 Rescue
查看>>
规范浮点数
查看>>
Qt 之 饼图
查看>>