Completed
Push — master ( d66c3c...7db86c )
by Alex
05:11
created

metadataResourceType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 31
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A metadataResourceTypeSetNamedStreamsOnDerivedEntityTypesNotSupported() 0 4 1
A metadataResourceTypeSetBagOfComplexTypeWithDerivedTypes() 0 4 1
1
<?php
2
namespace POData\Common\Messages;
3
4
trait metadataResourceType
5
{
6
    /**
7
     * Format a message to show error when entity type of an entity set has a
8
     * derived type with named stream property(ies).
9
     *
10
     * @param string $entitySetName   The entity set name
11
     * @param string $derivedTypeName The full name of the derived type
12
     *
13
     * @return string The formatted message
14
     */
15
    public static function metadataResourceTypeSetNamedStreamsOnDerivedEntityTypesNotSupported($entitySetName, $derivedTypeName)
16
    {
17
        return "Named streams are not supported on derived entity types. Entity Set '$entitySetName' has a instance of type '$derivedTypeName', which is an derived entity type and has named streams. Please remove all named streams from type '$derivedTypeName'.";
18
    }
19
20
    /**
21
     * Format a message to show error when complex type having derived type
22
     * is used as item type of a bag property.
23
     *
24
     * @param string $complexTypeName The name of the bag's complex type
25
     *                                having derived type
26
     *
27
     * @return string The formatted message
28
     */
29
    public static function metadataResourceTypeSetBagOfComplexTypeWithDerivedTypes($complexTypeName)
30
    {
31
        return "Complex type '$complexTypeName' has derived types and is used as the item type in a bag. Only bags containing complex types without derived types are supported.";
32
    }
33
34
}
35