Beispiel #1
0
 /**
  * @param Mongodloid collection $collection
  * @param array $entity
  * 
  * @return type
  * @todo move to model
  */
 public function getItem($id)
 {
     $entity = parent::getItem($id);
     if (isset($entity['urt'])) {
         $entity['urt'] = (new Zend_Date($entity['urt']->sec, null, new Zend_Locale('he_IL')))->getIso();
     }
     if (isset($entity['arate'])) {
         $data = $entity->get('arate', false);
         if ($data instanceof Mongodloid_Entity) {
             $entity['arate'] = $data->get('key');
         }
     }
     if (isset($entity['pzone'])) {
         $data = $entity->get('pzone', false);
         if ($data instanceof Mongodloid_Entity) {
             $entity['pzone'] = $data->get('key');
         }
     }
     if (isset($entity['wsc'])) {
         $data = $entity->get('wsc', false);
         if ($data instanceof Mongodloid_Entity) {
             $entity['wsc'] = $data->get('key');
         }
     }
     if (isset($entity['wsc_in'])) {
         $data = $entity->get('wsc_in', false);
         if ($data instanceof Mongodloid_Entity) {
             $entity['wsc_in'] = $data->get('key');
         }
     }
     return $entity;
 }
Beispiel #2
0
 public function getItem($id)
 {
     $entity = parent::getItem($id);
     $entity['from'] = (new Zend_Date($entity['from']->sec))->toString('YYYY-MM-dd HH:mm:ss');
     $entity['to'] = (new Zend_Date($entity['to']->sec))->toString('YYYY-MM-dd HH:mm:ss');
     return $entity;
 }