src/Listify.php
public function setListifyConfig($key, $value)
    {
        switch ($key) {

            case 'add_new_at':
                if ( ! method_exists($this, "addToList{$value}")) {
                    throw new \UnexpectedValueException("No method exists for applying the add_new_at value '{$value}'.");
                }
                break;

            case 'scope':
                $normalizedScope = $this->normalizeListifyScope($value);

                if (null !== $normalizedScope && ! is_string($normalizedScope)) {
                    throw new \InvalidArgumentException("Given list scope does not resolve to a usable where clause");
                }
                break;

            // default omitted on purpose
        }

        $this->listifyConfig[ $key ] = $value;


        if ($key === 'scope') {
            $this->rememberCurrentlyUsedScope();
        }

        return $this;
    }
public function setListifyConfig($key, $value)
    {
        switch ($key) {

            case 'add_new_at':
                if ( ! method_exists($this, "addToList{$value}")) {
                    throw new \UnexpectedValueException("No method exists for applying the add_new_at value '{$value}'.");
                }
                break;

            case 'scope':
                $normalizedScope = $this->normalizeListifyScope($value);

                if (null !== $normalizedScope && ! is_string($normalizedScope)) {
                    throw new \InvalidArgumentException("Given list scope does not resolve to a usable where clause");
                }
                break;

            // default omitted on purpose
        }

        $this->listifyConfig[ $key ] = $value;


        if ($key === 'scope') {
            $this->rememberCurrentlyUsedScope();
        }

        return $this;
    }
public function setListifyConfig ( $ key , $ value ) { switch ( $ key ) { case 'add_new_at' : if ( ! method_exists ( $ this , "addToList{$value}" ) ) { throw new \ UnexpectedValueException ( "No method exists for applying the add_new_at value '{$value}'." ) ; } break ; case 'scope' : $ normalizedScope = $ this -> normalizeListifyScope ( $ value ) ; if ( null !== $ normalizedScope && ! is_string ( $ normalizedScope ) ) { throw new \ InvalidArgumentException ( "Given list scope does not resolve to a usable where clause" ) ; } break ; // default omitted on purpose } $ this -> listifyConfig [ $ key ] = $ value ; if ( $ key === 'scope' ) { $ this -> rememberCurrentlyUsedScope ( ) ; } return $ this ; }
Sets a listify config value.

@param string
@param mixed
@return $this
Sets a listify config value .