New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use all class constants in m:enum, not only prefixed ones. #100

Merged
merged 1 commit into from Feb 14, 2017

Conversation

Projects
None yet
3 participants
@JanFolwarczny

JanFolwarczny commented Feb 13, 2017

Hi!

here is a little change of LeanMapper. With this change m:enum(SomeClass::*) can be used instead of only m:enum(SomeClass::SOME_*).

It is very useful when you have Enum classes like this one:

class WhenEnum {
    const NEVER = 'never';
    const ONCE = 'once';
    const EACH_TIME = 'eachTime';
}

So the entity could look like this:

/**
 * @property int $id
 * @property string $when m:enum(WhenEnum::*)
 */
class MyEntity extends \LeanMapper\Entity {
}

What do you think about that? It'll be great for me if it could be merged.

I'm looking forward to your answer!

Thanks, Jan

Jan Folwarczny
Allow to use all class constants in m:enum, not only prefixed ones.
SomeClass::* can be used instead of only SomeClass::SOME_*.
@Tharos

This comment has been minimized.

Show comment
Hide comment
@Tharos

Tharos Feb 13, 2017

Owner

It seems like a good idea to me. :)

@castamir Merge?

Owner

Tharos commented Feb 13, 2017

It seems like a good idea to me. :)

@castamir Merge?

@castamir castamir merged commit b385411 into Tharos:develop Feb 14, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@castamir castamir added this to the Stable 3.2.0 milestone Feb 14, 2017

@Tharos

This comment has been minimized.

Show comment
Hide comment
@Tharos
Owner

Tharos commented Feb 14, 2017

@JanFolwarczny

This comment has been minimized.

Show comment
Hide comment
@JanFolwarczny

JanFolwarczny commented Feb 14, 2017

@Tharos @castamir Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment