<?php
// +----------------------------------------------------------------------
// | OnlineRetailers [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2003-2023 www.yisu.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 王强 <opjklu@126.com>
// +----------------------------------------------------------------------

namespace Common\TypeParse\SonType;

use Common\TypeParse\AbstractParse;
use Common\TypeParse\ActionRunInterface;
/**
 * 数组类型解析
 * @author 王强
 * @version 1.0.1
 */
class ArrayType extends AbstractParse implements ActionRunInterface
{
    /**
     * {@inheritDoc}
     * @see \Common\TypeParse\ActionRunInterface::actionRun()
     */
    public function actionRun()
    {
        // TODO Auto-generated method stub
        $data = self::$typeData;
        sort($data);
        $number = rand(0, count($data) - 1);
        return $data[$number];
    }
    /**
     * {@inheritDoc}
     * @see \Common\TypeParse\ActionRunInterface::parseDataBaseByUser($model = null)
     */
    public function parseDataBaseByUser($model = null)
    {
        // TODO Auto-generated method stub
        
        if (!is_object($model)) {
            return false;
        }
        
        $data = self::$typeData;
        
        return $model->deleteGoods($data);
    }
    
}