forked from graphaware/neo4j-php-ogm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Duplicate initialization of LazyCollection issue graphaware#169
- Loading branch information
Showing
3 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
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
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
83 changes: 83 additions & 0 deletions
83
tests/Integration/Models/ManyToManyRelationship/Permission.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the GraphAware Neo4j PHP OGM package. | ||
* | ||
* (c) GraphAware Ltd <info@graphaware.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace GraphAware\Neo4j\OGM\Tests\Integration\Models\ManyToManyRelationship; | ||
|
||
use GraphAware\Neo4j\OGM\Annotations as OGM; | ||
use GraphAware\Neo4j\OGM\Common\Collection; | ||
|
||
/** | ||
* Class Permission. | ||
* | ||
* @OGM\Node(label="Permission") | ||
*/ | ||
class Permission | ||
{ | ||
/** | ||
* @OGM\GraphId() | ||
* | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @OGM\Property() | ||
* | ||
* @var string | ||
*/ | ||
protected $name; | ||
|
||
/** | ||
* @OGM\Relationship(type="HAS_PERMISSION", direction="INCOMING", mappedBy="permissions", collection=true, targetEntity="Group") | ||
* | ||
* @var Collection|Group[] | ||
*/ | ||
protected $groups; | ||
|
||
|
||
public function __construct($name) | ||
{ | ||
$this->name = $name; | ||
$this->groups = new Collection(); | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @return Collection|Group[] | ||
*/ | ||
public function getGroups() | ||
{ | ||
return $this->groups; | ||
} | ||
|
||
/** | ||
* @param string $name | ||
*/ | ||
public function setName($name) | ||
{ | ||
$this->name = $name; | ||
} | ||
} |