note 83502 modified in language.oop5.late-static-bindings by felipe
| From: | felipe@php.net | Date: | Fri, 30 May 2008 11:30:22 +0000 |
| Subject: | note 83502 modified in language.oop5.late-static-bindings by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139999@lists.php.net to get a copy of this message | ||
Finally we can implement some ActiveRecord methods:
<?php
class Model
{
public static function find()
{
echo static::$name;
}
}
class Product extends Model
{
protected static $name = 'Product';
}
Product::find();
?>
Output: 'Product'
--was--
Finally we can implement some ActiveRecord methods:
class Model
{
public static function find()
{
echo static::$name;
}
}
class Product extends Model
{
protected static $name = 'Product';
}
Product::find();
Output: 'Product'
http://php.net/manual/en/language.oop5.late-static-bindings.php