Created
April 5, 2014 00:02
-
-
Save antonioribeiro/9985438 to your computer and use it in GitHub Desktop.
trait
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Eloquent { | |
} | |
class Sentry extends Eloquent { | |
protected $guarded = [ | |
'sentry column', | |
]; | |
} | |
class Vocal extends Eloquent { | |
protected $guarded = [ | |
'vocal column', | |
]; | |
} | |
trait UserTraits { | |
protected $guarded = [ | |
'password', | |
]; | |
} | |
class SentryUser extends Sentry { | |
use UserTraits; | |
} | |
class VocalUser extends Vocal { | |
use UserTraits; | |
} | |
$foo = new SentryUser; | |
var_dump($foo); | |
// Cartalyst\Sentry\Users\Eloquent\User and App\Traits define the same property ($guarded) in the composition of App\Model. | |
// However, the definition differs and is considered incompatible. Class was composed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment