private function parseWordToken(AbstractToken $token)
 {
     $parsed = [];
     $value = $token->getValue();
     switch (true) {
         case $token instanceof WordToken:
             $parsed['field'] = MediaStorage::MEDIA_STORAGE_TABLE . '.name';
             $parsed['condition'] = 'LIKE';
             $parsed['value'] = '%' . $value . '%';
             break;
         case $token instanceof TripToken:
             $parsed['field'] = ':' . MediaStorage::MEDIA_USAGE_TABLE . '.namespace';
             $parsed['condition'] = 'LIKE';
             $parsed['value'] = '%trip/' . $value . '%';
             break;
         case $token instanceof ExperienceToken:
             $parsed['field'] = ':' . MediaStorage::MEDIA_USAGE_TABLE . '.namespace';
             $parsed['condition'] = 'LIKE';
             $parsed['value'] = '%experience/' . $value . '%';
             break;
         case $token instanceof NsToken:
             $parsed['field'] = ':' . MediaStorage::MEDIA_USAGE_TABLE . '.namespace';
             $parsed['condition'] = 'LIKE';
             $parsed['value'] = '%' . $value . '%';
             break;
         case $token instanceof ExtensionToken:
             $parsed['field'] = MediaStorage::MEDIA_STORAGE_TABLE . '.name';
             $parsed['condition'] = 'LIKE';
             $parsed['value'] = '%' . $value . '';
             break;
     }
     return $parsed;
 }
Beispiel #2
0
 public function __construct($value = null)
 {
     parent::__construct(SimpleQueryTokenizer::ANDOP);
 }