public static function createBrickFromPostValues($postValues)
    {
        if (isset($postValues['title'])) {
            $brickObject = new \stdClass();
            $brickObject->title = $postValues['title'];
            $brickObject->slug = StringUtil::slugify($postValues['title']);
            $brickObject->fields = array();
            if (isset($postValues['fieldTitles'], $postValues['fieldTypes'], $postValues['fieldRequired'], $postValues['fieldMultiple'])) {
                foreach ($postValues['fieldTitles'] as $key => $value) {
                    $fieldObject = self::createFieldObject($postValues, $value, $key);

                    $brickObject->fields[] = $fieldObject;
                }
            }

            return $brickObject;
        } else {
            throw new \Exception('Trying to create document type with invalid data.');
        }
    }