public function setAccess($value)
    {
        $values = (array) $value;

        foreach ($values as $key => $value) {
            if (empty($value)) {
                $value = self::GUEST;
            } elseif (!is_numeric($value)) {
                if (!in_array($value, array('public', 'registered', 'followers', 'special', 'leaders', 'mutuals', 'admins'))) {
                    $value = self::GUEST;
                }
            }

            if ($value == self::GUEST) {
                $values = array(self::GUEST);
                break;
            }

            if ($this->_mixer->authorize('setprivacyvalue', array('value' => $key)) === false) {
                unset($values[$key]);
            } else {
                $values[$key] = $value;
            }
        }

        asort($values);

        $values = array_unique($values);

        $this->set('access', implode(',', $values));

        return $this;
    }
public function setAccess($value)
    {
        $values = (array) $value;

        foreach ($values as $key => $value) {
            if (empty($value)) {
                $value = self::GUEST;
            } elseif (!is_numeric($value)) {
                if (!in_array($value, array('public', 'registered', 'followers', 'special', 'leaders', 'mutuals', 'admins'))) {
                    $value = self::GUEST;
                }
            }

            if ($value == self::GUEST) {
                $values = array(self::GUEST);
                break;
            }

            if ($this->_mixer->authorize('setprivacyvalue', array('value' => $key)) === false) {
                unset($values[$key]);
            } else {
                $values[$key] = $value;
            }
        }

        asort($values);

        $values = array_unique($values);

        $this->set('access', implode(',', $values));

        return $this;
    }
public function setAccess ( $ value ) { $ values = ( array ) $ value ; foreach ( $ values as $ key => $ value ) { if ( empty ( $ value ) ) { $ value = self :: GUEST ; } elseif ( ! is_numeric ( $ value ) ) { if ( ! in_array ( $ value , array ( 'public' , 'registered' , 'followers' , 'special' , 'leaders' , 'mutuals' , 'admins' ) ) ) { $ value = self :: GUEST ; } } if ( $ value == self :: GUEST ) { $ values = array ( self :: GUEST ) ; break ; } if ( $ this -> _mixer -> authorize ( 'setprivacyvalue' , array ( 'value' => $ key ) ) === false ) { unset ( $ values [ $ key ] ) ; } else { $ values [ $ key ] = $ value ; } } asort ( $ values ) ; $ values = array_unique ( $ values ) ; $ this -> set ( 'access' , implode ( ',' , $ values ) ) ; return $ this ; }
Set the access value of the node. Access value is basically a read persmission for a node.
This value can be checked during fetching the record from the database to see if the
viewer has access to it or not.

@param int|string $access Access value. Can be a string or an id of another node

@return LibBaseDomainBehaviorPrivatable
Set the access value of the node . Access value is basically a read persmission for a node . This value can be checked during fetching the record from the database to see if the viewer has access to it or not .