1 <?php
 2  3  4 
 5 namespace Team3\PayU\Order\Model;
 6 
 7 trait IsFilledTrait
 8 {
 9     10 11 12 13 
14     public function isFilled()
15     {
16         $reflectionClass = new \ReflectionClass($this);
17         $reflectionProperties = $reflectionClass->getProperties();
18 
19         
20         foreach ($reflectionProperties as $reflectionProperty) {
21             $reflectionProperty->setAccessible(true);
22             $value = $reflectionProperty->getValue($this);
23 
24             if ($value instanceof IsFilledInterface) {
25                 if ($value->isFilled()) {
26                     return true;
27                 }
28                 break;
29             }
30 
31             if (null !== $value) {
32                 return true;
33             }
34         }
35 
36         return false;
37     }
38 }
39