Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Model {
- public static $table='table';
- public static function getTable() {
- return self::$table;
- }
- }
- class User extends Model{
- public static $table='users';
- }
- echo User::getTable(); //выведет 'table'
- class Model {
- public static $table='table';
- public static function getTable() {
- return static::$table;
- }
- }
- class User extends Model{
- public static $table='users';
- }
- echo User::getTable(); //выведет 'users'
- class Model {
- public static $table='table';
- public static function foo() {
- echo "1_test";
- }
- }
- class User extends Model{
- public static function foo() {
- echo "2_test";
- parent::foo();
- }
- }
- echo User::foo(); //выведет '2_test1_test'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement