Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.idea
/nbproject
/_local
/vendor
/composer.lock
20 changes: 10 additions & 10 deletions src/LeanMapper/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class Entity
protected static $reflections = [];

/** @var EntityReflection|null */
private $currentReflection;
protected $currentReflection;



Expand Down Expand Up @@ -860,7 +860,7 @@ protected function initDefaults()
* @throws InvalidValueException
* @return Entity|null
*/
private function getHasOneValue(Property $property, Relationship\HasOne $relationship, Filtering $filtering = null)
protected function getHasOneValue(Property $property, Relationship\HasOne $relationship, Filtering $filtering = null)
{
$targetTable = $relationship->getTargetTable();
$row = $this->row->referenced($targetTable, $relationship->getColumnReferencingTargetTable(), $filtering);
Expand Down Expand Up @@ -890,7 +890,7 @@ private function getHasOneValue(Property $property, Relationship\HasOne $relatio
* @return Entity[]
* @throws InvalidValueException
*/
private function getHasManyValue(
protected function getHasManyValue(
Property $property,
Relationship\HasMany $relationship,
Filtering $targetTableFiltering = null,
Expand Down Expand Up @@ -927,7 +927,7 @@ private function getHasManyValue(
* @return Entity|null
* @throws InvalidValueException
*/
private function getBelongsToOneValue(Property $property, Relationship\BelongsToOne $relationship, Filtering $filtering = null)
protected function getBelongsToOneValue(Property $property, Relationship\BelongsToOne $relationship, Filtering $filtering = null)
{
$targetTable = $relationship->getTargetTable();
$rows = $this->row->referencing($targetTable, $relationship->getColumnReferencingSourceTable(), $filtering, $relationship->getStrategy());
Expand Down Expand Up @@ -961,7 +961,7 @@ private function getBelongsToOneValue(Property $property, Relationship\BelongsTo
* @param Filtering|null $filtering
* @return Entity[]
*/
private function getBelongsToManyValue(Property $property, Relationship\BelongsToMany $relationship, Filtering $filtering = null)
protected function getBelongsToManyValue(Property $property, Relationship\BelongsToMany $relationship, Filtering $filtering = null)
{
$targetTable = $relationship->getTargetTable();
$rows = $this->row->referencing($targetTable, $relationship->getColumnReferencingSourceTable(), $filtering, $relationship->getStrategy());
Expand All @@ -985,7 +985,7 @@ private function getBelongsToManyValue(Property $property, Relationship\BelongsT
* @throws InvalidMethodCallException
* @throws InvalidStateException
*/
private function useMapper(IMapper $mapper)
protected function useMapper(IMapper $mapper)
{
if ($this->mapper === null) {
$newProperties = $this->getReflection($mapper)->getEntityProperties();
Expand Down Expand Up @@ -1018,7 +1018,7 @@ private function useMapper(IMapper $mapper)
* @param IEntityFactory $entityFactory
* @throws InvalidStateException
*/
private function setEntityFactory(IEntityFactory $entityFactory)
protected function setEntityFactory(IEntityFactory $entityFactory)
{
if ($this->entityFactory === null) {
$this->entityFactory = $entityFactory;
Expand All @@ -1039,7 +1039,7 @@ private function setEntityFactory(IEntityFactory $entityFactory)
* @throws InvalidArgumentException
* @throws InvalidValueException
*/
private function addToOrRemoveFrom($action, $name, $arg)
protected function addToOrRemoveFrom($action, $name, $arg)
{
if ($this->isDetached()) {
throw new InvalidMethodCallException('Cannot add or remove related entity to detached entity.');
Expand Down Expand Up @@ -1108,7 +1108,7 @@ private function addToOrRemoveFrom($action, $name, $arg)
* @param Entity $entity
* @throws InvalidValueException
*/
private function checkConsistency(Property $property, $mapperClass, Entity $entity)
protected function checkConsistency(Property $property, $mapperClass, Entity $entity)
{
$type = $property->getType();
if (!($entity instanceof $type)) {
Expand All @@ -1127,7 +1127,7 @@ private function checkConsistency(Property $property, $mapperClass, Entity $enti
* @param string $methodName
* @throws InvalidMethodCallException
*/
private function checkMethodArgumentsCount($expectedCount, array $arguments, $methodName)
protected function checkMethodArgumentsCount($expectedCount, array $arguments, $methodName)
{
if (count($arguments) !== $expectedCount) {
if ($expectedCount === 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/LeanMapper/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Events
const EVENT_AFTER_DELETE = 'afterDelete';

/** @var array */
private $events = [
protected $events = [
self::EVENT_BEFORE_PERSIST => [],
self::EVENT_BEFORE_CREATE => [],
self::EVENT_BEFORE_UPDATE => [],
Expand Down Expand Up @@ -99,7 +99,7 @@ public function &getCallbacksReference($event)
* @param string $event
* @throws InvalidArgumentException
*/
private function checkEventType($event)
protected function checkEventType($event)
{
if (!isset($this->events[$event])) {
throw new InvalidArgumentException("Unknown event type given: '$event'.");
Expand Down
20 changes: 10 additions & 10 deletions src/LeanMapper/Reflection/EntityReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ class EntityReflection extends \ReflectionClass
{

/** @var IMapper|null */
private $mapper;
protected $mapper;

/** @var Property[] */
private $properties = null;
protected $properties = null;

/** @var array */
private $getters = null;
protected $getters = null;

/** @var array */
private $setters = null;
protected $setters = null;

/** @var Aliases|null */
private $aliases;
protected $aliases;

/** @var string */
private $docComment;
protected $docComment;

/** @var array */
private $internalGetters = ['getData', 'getRowData', 'getModifiedRowData', 'getCurrentReflection', 'getReflection', 'getHasManyRowDifferences', 'getEntityClass'];
protected $internalGetters = ['getData', 'getRowData', 'getModifiedRowData', 'getCurrentReflection', 'getReflection', 'getHasManyRowDifferences', 'getEntityClass'];



Expand Down Expand Up @@ -182,7 +182,7 @@ public function getSetter($name)
/**
* @throws InvalidStateException
*/
private function parseProperties()
protected function parseProperties()
{
$this->properties = [];
$annotationTypes = ['property', 'property-read'];
Expand Down Expand Up @@ -215,7 +215,7 @@ private function parseProperties()



private function initGettersAndSetters()
protected function initGettersAndSetters()
{
$this->getters = $this->setters = [];
foreach ($this->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
Expand All @@ -237,7 +237,7 @@ private function initGettersAndSetters()
/**
* @return self[]
*/
private function getFamilyLine()
protected function getFamilyLine()
{
$line = [$member = $this];
while ($member = $member->getParentClass()) {
Expand Down
32 changes: 16 additions & 16 deletions src/LeanMapper/Reflection/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,49 @@ class Property
{

/** @var string */
private $name;
protected $name;

/** @var string|null */
private $column;
protected $column;

/** @var EntityReflection */
private $entityReflection;
protected $entityReflection;

/** @var PropertyType */
private $type;
protected $type;

/** @var bool */
private $isWritable;
protected $isWritable;

/** @var bool */
private $isNullable;
protected $isNullable;

/** @var bool */
private $hasDefaultValue;
protected $hasDefaultValue;

/** @var mixed|null */
private $defaultValue;
protected $defaultValue;

/** @var bool */
private $containsCollection;
protected $containsCollection;

/** @var Relationship\HasOne|Relationship\HasMany|Relationship\BelongsToOne|Relationship\BelongsToMany|null */
private $relationship;
protected $relationship;

/** @var PropertyMethods|null */
private $propertyMethods;
protected $propertyMethods;

/** @var PropertyFilters|null */
private $propertyFilters;
protected $propertyFilters;

/** @var PropertyPasses|null */
private $propertyPasses;
protected $propertyPasses;

/** @var PropertyValuesEnum|null */
private $propertyValuesEnum;
protected $propertyValuesEnum;

/** @var array */
private $customFlags;
protected $customFlags;



Expand Down Expand Up @@ -438,7 +438,7 @@ public function getCustomFlagValue($name)
/**
* @throws InvalidMethodCallException
*/
private function checkContainsEnumeration()
protected function checkContainsEnumeration()
{
if (!$this->containsEnumeration()) {
throw new InvalidMethodCallException(
Expand Down
Loading