Skip to content

Commit

Permalink
Merge pull request doctrine-extensions#1189 from dunglas/traits
Browse files Browse the repository at this point in the history
Fix traits use statements
  • Loading branch information
stof committed Jan 29, 2015
2 parents 5e19886 + ff30b93 commit acbf585
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 15 deletions.
5 changes: 0 additions & 5 deletions doc/blameable.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ to use the Traits provided by extensions.
namespace Blameable\Fixture;

use Gedmo\Blameable\Traits\BlameableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;

/**
Expand Down Expand Up @@ -640,10 +639,6 @@ class UsingTrait
}
```

**Note:** you must import **Gedmo\Mapping\Annotation as Gedmo** and **Doctrine\ORM\Mapping as ORM**
annotations. If you use mongodb ODM import **Doctrine\ODM\MongoDB\Mapping\Annotations as ODM** and
**BlameableDocument** instead.

The Traits are very simplistic - if you use different field names it is recommended to simply create your
own Traits specific to your project. The ones provided by this bundle can be used as example.

5 changes: 0 additions & 5 deletions doc/ip_traceable.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ to use the Traits provided by extensions.
namespace IpTraceable\Fixture;

use Gedmo\IpTraceable\Traits\IpTraceableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;

/**
Expand Down Expand Up @@ -549,10 +548,6 @@ class UsingTrait
}
```

**Note:** you must import **Gedmo\Mapping\Annotation as Gedmo** and **Doctrine\ORM\Mapping as ORM**
annotations. If you use mongodb ODM import **Doctrine\ODM\MongoDB\Mapping\Annotations as ODM** and
**IpTraceableDocument** instead.

The Traits are very simplistic - if you use different field names it is recommended to simply create your
own Traits specific to your project. The ones provided by this bundle can be used as example.

Expand Down
5 changes: 0 additions & 5 deletions doc/timestampable.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,6 @@ to use the Traits provided by extensions.
namespace Timestampable\Fixture;

use Gedmo\Timestampable\Traits\TimestampableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;

/**
Expand Down Expand Up @@ -676,10 +675,6 @@ class UsingTrait
}
```

**Note:** you must import **Gedmo\Mapping\Annotation as Gedmo** and **Doctrine\ORM\Mapping as ORM**
annotations. If you use mongodb ODM import **Doctrine\ODM\MongoDB\Mapping\Annotations as ODM** and
**TimestampableDocument** instead.

Traits are very simple and if you use different field names I recommend to simply create your
own ones based per project. These ones are standing as an example.

1 change: 1 addition & 0 deletions lib/Gedmo/Blameable/Traits/BlameableDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gedmo\Blameable\Traits;

use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Gedmo/Blameable/Traits/BlameableEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gedmo\Blameable\Traits;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Gedmo/IpTraceable/Traits/IpTraceableDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gedmo\IpTraceable\Traits;

use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Gedmo/IpTraceable/Traits/IpTraceableEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gedmo\IpTraceable\Traits;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
Expand Down
2 changes: 2 additions & 0 deletions lib/Gedmo/SoftDeleteable/Traits/SoftDeleteableDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Gedmo\SoftDeleteable\Traits;

use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/**
* SoftDeletable Trait, usable with PHP >= 5.4
*
Expand Down
2 changes: 2 additions & 0 deletions lib/Gedmo/SoftDeleteable/Traits/SoftDeleteableEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Gedmo\SoftDeleteable\Traits;

use Doctrine\ORM\Mapping as ORM;

/**
* SoftDeletable Trait, usable with PHP >= 5.4
*
Expand Down
1 change: 1 addition & 0 deletions lib/Gedmo/Timestampable/Traits/TimestampableDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gedmo\Timestampable\Traits;

use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Gedmo/Timestampable/Traits/TimestampableEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gedmo\Timestampable\Traits;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
Expand Down
1 change: 1 addition & 0 deletions lib/Gedmo/Tree/Traits/NestedSetEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Gedmo\Tree\Traits;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
Expand Down

0 comments on commit acbf585

Please sign in to comment.