public function guard($identifier, $context = '')
    {
        foreach ($this->getGuardians() as $guardian) {
            
            if ($guardian instanceof ContextualMetadataGuardian && $guardian->getContext() !== $context) {
                continue;
            }
            
            if ($this->hasMetadataValue($identifier)) {
                \common_Logger::i(__('Guard for resource "%s"...', $identifier));
                if (($guard = $guardian->guard($this->getMetadataValue($identifier))) !== false) {
                    return $guard;
                }
            }
        }
        return false;
    }
public function guard($identifier, $context = '')
    {
        foreach ($this->getGuardians() as $guardian) {
            
            if ($guardian instanceof ContextualMetadataGuardian && $guardian->getContext() !== $context) {
                continue;
            }
            
            if ($this->hasMetadataValue($identifier)) {
                \common_Logger::i(__('Guard for resource "%s"...', $identifier));
                if (($guard = $guardian->guard($this->getMetadataValue($identifier))) !== false) {
                    return $guard;
                }
            }
        }
        return false;
    }
public function guard ( $ identifier , $ context = '' ) { foreach ( $ this -> getGuardians ( ) as $ guardian ) { if ( $ guardian instanceof ContextualMetadataGuardian && $ guardian -> getContext ( ) !== $ context ) { continue ; } if ( $ this -> hasMetadataValue ( $ identifier ) ) { \ common_Logger :: i ( __ ( 'Guard for resource "%s"...' , $ identifier ) ) ; if ( ( $ guard = $ guardian -> guard ( $ this -> getMetadataValue ( $ identifier ) ) ) !== false ) { return $ guard ; } } } return false ; }
Guard a metadata identifier at import

Guard a metadata identifier by calling guard method of each guardians
If guardians have no reason to stop process, true is returned
If a guardian does not allow the import, the target guardian is returned

@param $identifier
@return bool
Guard a metadata identifier at import