src/Api/Service/RevisionGetter.php 1 location
|
@@ 111-120 (lines=10) @@
|
108 |
|
* @return ItemContent|PropertyContent |
109 |
|
* @todo this could be factored into a different class? |
110 |
|
*/ |
111 |
|
private function getContentFromEntity( $entity ) { |
112 |
|
switch ( $entity->getType() ) { |
113 |
|
case Item::ENTITY_TYPE: |
114 |
|
return new ItemContent( $entity ); |
115 |
|
case Property::ENTITY_TYPE: |
116 |
|
return new PropertyContent( $entity ); |
117 |
|
default: |
118 |
|
throw new RuntimeException( 'I cant get a content for this type of entity' ); |
119 |
|
} |
120 |
|
} |
121 |
|
|
122 |
|
} |
123 |
|
|
src/Api/Service/RevisionsGetter.php 1 location
|
@@ 130-139 (lines=10) @@
|
127 |
|
* @return ItemContent|PropertyContent |
128 |
|
* @todo this could be factored into a different class? |
129 |
|
*/ |
130 |
|
private function getContentFromEntity( $entity ) { |
131 |
|
switch ( $entity->getType() ) { |
132 |
|
case Item::ENTITY_TYPE: |
133 |
|
return new ItemContent( $entity ); |
134 |
|
case Property::ENTITY_TYPE: |
135 |
|
return new PropertyContent( $entity ); |
136 |
|
default: |
137 |
|
throw new RuntimeException( 'I cant get a content for this type of entity' ); |
138 |
|
} |
139 |
|
} |
140 |
|
|
141 |
|
} |
142 |
|
|