public function setAttributes($values, $safeOnly=true)
    {
        $flags = $this->cachedFlags();
        $notFlags = array();
        foreach ($values as $key => $val) {
            if (array_key_exists($key, $flags)) {
                $this->setFlag($key, $val);
            }
            else {
                $notFlags[$key] = $val;
            }
        }
        parent::setAttributes($notFlags, $safeOnly);
    }