<?php

namespace Benhauer\Salesmanago\Model;

use \SALESmanago\Model\CreateInterface;
use \Benhauer\Salesmanago\Model\AbstractModel as SalesmanagoAbstractModel;

class Create extends SalesmanagoAbstractModel implements CreateInterface
{
    public function insert($settings)
    {
        $this
            ->setClientId($settings[self::C_CLIENT_ID])
            ->setSHA($settings[self::C_SHA])
            ->setApiKey($settings[self::C_API_KEY])
            ->setOwner($settings[self::OWNER])
            ->setEndpoint($settings[self::C_ENDPOINT])
            ->setToken($settings[self::C_TOKEN])
            ->setExpiresTokenAt();

        $this->setDefaultAdditionalDataAfterInit();

        $this->clearCache();
    }
}
