<?php
require_once OCS_APPLICATION_PATH
    . '/services/Optimization/Factor/Abstract/Base.php';

abstract class Ocs_Service_Optimization_Factor_Abstract_Decoration
    extends Ocs_Service_Optimization_Factor_Abstract_Base
{
    protected function _postAnalyze($result)
    {
        if (Ocs_Service_Optimization::STATUS_NO == $result
            && 'disabled' == $this->_parent->getData('extra_content_mode')
        ) {
            $count = $this->_parent->getData('keyword_count');
            if ($count <= 0) {
                $result = Ocs_Service_Optimization::STATUS_NA;
            } else if ($this->_selected) {
                $this->_parent->setData('keyword_count', $count-1);
            }
        }

        return $result;
    }
}