User register

@trigger Event::EVENT_REGISTER
@param array $data
@return \Grid\User\Model\User\Structure
544800
public function register(Array $data)
    {
        $event = new Event\Register();
        $event->setData($data);
        $this->getEventManager()->trigger($event);
        return $event->getUser();
    }
365067
public static function trigger($event, &$data)
    {
        if (!isset(self::$manager)) {
            self::init();
        }

        return self::$manager->triggerEvent($event, $data);
    }
127947
protected function createSubscribeEvent(array $data)
    {
        if (isset($data['EventKey']) && isset($data['Ticket']) && (WxReceiveEvent::EVENT_TYPE_SUBSCRIBE == $data['Event'])) {
            return $this->createScanEvent($data);
        }

        $result = new WxReceiveSubscribeEvent();
        $this->initReceive($result, $data);
        $result->setEvent($data['Event']);

        return $result;
    }
1220679
public function store(array $data)
    {
        $projectConstruction = $this->client->post(
            sprintf('templates/%d/project_constructions.json', $this->parent),
            [
                'json' => $data,
            ]
        );

        return $this->response($projectConstruction);
    }
885026
public function triggerEvent($name, array $data = [])
    {
        try {
            /** @var EventInterface $event */
            $event = $this->createEventObject($name, $data);
        } catch (\InvalidArgumentException $exception) {
            return $this;
        }

        foreach ($this->options['events'][$name]['listeners'] as $eventListener) {
            if ($event->isPropagationStopped()) {
                $this->loggerInstance->makeLogEvent($name, $eventListener, self::EVENT_STATUS_BREAK);
                break;
            }

            $this->executeListener($eventListener, $event, $name);
        }

        return $this;
    }
1000521
protected function create(array $data)
    {
        $fields = [
            'name'     => $data['name'],
            'email'    => $data['email'],
            'password' => bcrypt($data['password']),
        ];
        if (config('auth.providers.users.field', 'email') === 'username' && isset($data['username'])) {
            $fields['username'] = $data['username'];
        }
        return User::create($fields);
    }
928262
protected function createEntry(array $data)
    {
        return Entity\AccountNode::fromNode(parent::createEntry($data), $this->getConnection()->getConfiguration());
    }
801242
public function bindLocation(array $data)
    {
        $url = "https://api.weixin.qq.com/shakearound/device/bindlocation?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
620568
public static function register($key, $value, $data = [])
    {
        if (!self::_tableExists()) {
            return;
        }

        self::autoLoad();

        $_data = [
            'value' => $value,
            'editable' => 1,
            'autoload' => true,
            'options' => [],
            'description' => null,
        ];

        $data = array_merge($_data, $data);

        // Don't overrule because we register
        $data['overrule'] = false;

        self::options($key, $data['options']);

        self::write($key, $data['value'], $data);
    }
1334734
public function render($data = [])
    {
        $this->registerPaths();

        $data = new Data($data);

        $this->prepareData($data);

        $this->prepareGlobals($data);

        if ($this->isDebug()) {
            $data->paths = iterator_to_array(clone $this->getPaths());
        }

        return $this->renderer->render($this->layout, $data);
    }
235947
protected function create(array $data)
    {
        if (!isset($data['name']) || trim($data['name']) == '') {
            $data['name'] = $data['email'];
        }
        $user = User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            ]);
        return $user;
    }
713211
protected function create(array $data)
    {
        $user = UserGate::create([
            'first_name' => $data[ 'first_name' ],
            'last_name'  => $data[ 'last_name' ],
            'username'   => $data[ 'username' ],
            'email'      => $data[ 'email' ],
            'password'   => bcrypt($data[ 'password' ]),
            'enabled'    => 1,
        ]);

        if ($user) {
            $user->attachRole(2);
        }

        return $user;
    }
1048209
protected function __apiStore(array $data = null)
    {
        if( is_null($data) ) {
            $data = $this->getInputData();
        }

        (new HCUsersValidator())->validateForm();

        $record = createHCUser(
            array_get($data, 'record.email'),
            array_get($data, 'roles'),
            request()->has('is_active'),
            array_get($data, 'record.password'),
            [],
            request()->has('send_welcome_email'),
            request()->has('send_password')
        );

        return $this->apiShow($record->id);
    }
295421
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('user.add.before', $data, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        if (empty($data['name'])) {
            $data['name'] = strtok($data['email'], '@');
        }

        $data['created'] = $data['modified'] = GC_TIME;
        $data['hash'] = gplcart_string_hash($data['password']);
        $result = $data['user_id'] = $this->db->insert('user', $data);

        $this->setAddress($data);

        $this->hook->attach('user.add.after', $data, $result, $this);
        return (int) $result;
    }
999167
public function bind (array $data) : TemplateInterface
    {
        $this->data = array_merge($this->data, $data);
        return $this;
    }
940958
public function create($data = [])
    {
        if (! $data) {
            $data = $this->data;
        } else {
            $this->populate($data);
        }

        $response = $this->client->post('', [], $data);

        if (!$response->hasErrors()) {
            $this->event->dispatch('SUBSCRIPTION.UPDATE', new SubscriptionsEvent($this->data));
        }

        return $this;
    }
1084708
public function add(array $data): self
    {
        $this->data = array_merge_recursive($this->data, $data);
        return $this;
    }