<?php
/**
 * Created by PhpStorm.
 * User: Imac
 * Date: 24/04/2019
 * Time: 14:16
 */

namespace Actigraph\ActipageBaseBundle\Services\EspaceClient;


class ValidateCommonClient implements ValidateFormEspaceClient
{

    public function __construct()
    {

    }


    public function renderHtml()
    {
        return "";
    }

    public function validateData($postData)
    {
        if(isset($postData["common"])) {
            $data = $postData["common"];
            $error = array();
            if (isset($data["Nom"]) && strlen($data["Nom"]) < 5)
                array_push($error, "Le nom doit être supérieur à 5");

            if (count($error) > 0)
                return $error;
        }

        return true;
    }
    public function saveData($postData){
        if(isset($postData["common"])) {
            $data = $postData["common"];

        }
        return true;
    }
}