src/libraries/adapters/DatabaseSimpleDb.php
/**
    * Normalizes data from simpleDb into schema definition
    *
    * @param SimpleXMLObject $raw A photo from SimpleDb in SimpleXML.
    * @return array
    */
Normalizes data from simpleDb into schema definition
@param SimpleXMLObject $raw A photo from SimpleDb in SimpleXML.
@return array
Normalizes data from simpleDb into schema definition @param SimpleXMLObject $raw A photo from SimpleDb in SimpleXML . @return array
private function normalizePhoto($raw)
  {
    $photo = array('tags' => array());
    $photo['id'] = strval($raw->Name);
    $photo['appId'] = $this->config->application->appId;
    foreach($raw->Attribute as $item)
    {
      $name = (string)$item->Name;
      $value = (string)$item->Value;
      if($name == 'tags' || $name == 'groups')
      {
        if($value != '')
          $photo[$name][] = $value;
        continue;
      }
      $photo[$name] = $value;
    }
    if(isset($photo['tags']))
    {
      $tags = $photo['tags'];
      natcasesort($tags);
      $photo['tags'] = array();
      foreach($tags as $tag)
        $photo['tags'][] = $tag;
    }
    return $photo;
  }
private function normalizePhoto ( $ raw ) { $ photo = array ( 'tags' => array ( ) ) ; $ photo [ 'id' ] = strval ( $ raw -> Name ) ; $ photo [ 'appId' ] = $ this -> config -> application -> appId ; foreach ( $ raw -> Attribute as $ item ) { $ name = ( string ) $ item -> Name ; $ value = ( string ) $ item -> Value ; if ( $ name == 'tags' || $ name == 'groups' ) { if ( $ value != '' ) $ photo [ $ name ] [ ] = $ value ; continue ; } $ photo [ $ name ] = $ value ; } if ( isset ( $ photo [ 'tags' ] ) ) { $ tags = $ photo [ 'tags' ] ; natcasesort ( $ tags ) ; $ photo [ 'tags' ] = array ( ) ; foreach ( $ tags as $ tag ) $ photo [ 'tags' ] [ ] = $ tag ; } return $ photo ; }
Normalizes data from simpleDb into schema definition
 @param SimpleXMLObject $raw A photo from SimpleDb in SimpleXML.
Normalizes data from simpleDb into schema definition @param SimpleXMLObject $raw A photo from SimpleDb in SimpleXML .
// we have to do this because natcasesort preserves array keys and turns it into an object literal (not an array literal)