@param int   $id
@param mixed $payload

@return mixed|void
510136
public function fireEdit($id, $payload = [])
    {
        if (! method_exists($this, 'onEdit')) {
            return;
        }

        $payload = array_merge(['id' => $id], ['payload' => $payload]);

        $form = $this->app->call([$this, 'onEdit'], $payload);

        if ($form instanceof DisplayInterface) {
            $form->setModelClass($this->getClass());
        }

        if ($form instanceof Initializable) {
            $form->initialize();
        }

        if ($form instanceof FormInterface) {
            $form->setAction($this->getUpdateUrl($id));
            $form->setId($id);
        }

        return $form;
    }
83402
public function bind(array $payload=null)
    {
        $bound = false;
        $this->_boundEntities = array();

        if (!is_null($payload)
            && isset($payload[$this->getName()])
            && $this->validateSynchronizerToken($payload)
        ) {
            $this->logger->debug('start binding form', array('name' => $this->getName(), 'payload' => $payload));

            $propertyMapper = new PropertyMapper();

            /**
             * @var $entityContainer    \Naucon\Form\Mapper\EntityContainerInterface
             */
            if ($this->getEntityContainerMap()->count() > 0) {
                if (!is_null($entityContainer = current($this->getEntityContainerMap()->getAll()))) {
                    $propertyMapper->mapFormToData($entityContainer->getEntity(), $payload[$this->getName()]);
                    $this->addBoundEntity($entityContainer->getEntity());

                    // postbind hook
                    $this->logger->debug('invoke form postbind hook', array('name' => $this->getName(), 'entity' => $entityContainer->getName()));
                    $entityContainer->invokeHook('postbindHook');

                    $bound = true;
                }
            }
        }


        $this->setBound($bound);

        $this->logger->debug('execute post binding form', array('name' => $this->getName()));
        $this->postBind();

        if ($this->isBound()) {
            $this->logger->debug('finished binding form successful', array('name' => $this->getName()));
        } else {
            $this->logger->debug('finished binding form failed', array('name' => $this->getName()));
        }
        return $this->isBound();
    }
1051917
public function onData(Payload $payload)
    {
        $this->received[] = $payload;
        if (($callback = $this->options['on_data_callback'])) {
            call_user_func($callback, $payload);
        }
    }
1259415
public function execute($action, array $payload)
    {
        $executor = $this->getExecutor($action);

        // dispatch pre event, listeners may change the payload here
        $event = new ExecutionEvent($executor, $action, $payload);
        $this->dispatcher->dispatch(WorkerEvents::PRE_EXECUTE_ACTION, $event);

        try {
            $resolver = $this->getPayloadResolver($executor);
            $payload  = $resolver->resolve($event->getPayload());
        } catch (ExceptionInterface $exception) {
            $this->logger->error(
                sprintf(
                    'Payload %s for "%s" is invalid: %s',
                    json_encode($payload, JSON_UNESCAPED_SLASHES),
                    $action,
                    $exception->getMessage()
                )
            );

            return false;
        }

        $result = $executor->execute($payload);
        // dispatch post event, listeners may change the result here
        $event->setResult($result);
        $this->dispatcher->dispatch(WorkerEvents::POST_EXECUTE_ACTION, $event);

        return $event->getResult();
    }
775810
public function run(Request $request, PayloadInterface $payload = null) {
		return new Response($this->render('/keeko/account/templates/change-password.twig', [
			'target' => $request->getUri(),
			'submitted' => $request->isMethod('POST'),
			'success' => $payload instanceof Success
		]));
	}
72516
public function delete($id)
    {
        $entity = $this->findById($id);
        $entity = $this->beforeDelete($entity);

        $this->getEntityManager()->remove($entity);
        $this->getEntityManager()->flush();

        $this->afterDelete($entity);
    }
341079
function post($payload)
    {
        $this->requestDecorator->setPayload($payload);
        $result = $this->client->post($this->requestDecorator->makeResource(), $this->requestDecorator->makePayload(), $this->requestDecorator->makeHeaders());
        $this->refresh();
        return $result;
    }
809678
protected function setMessagePayload(array $payload): void
    {
        $this->payloadOrigin = new ImmutableParameter($payload);
        $temp = [];

        foreach ($payload as $key => $value) {
            $property = $this->toCamelCase($key);

            if (property_exists($this, $property)) {
                $this->setPropValue($property, $value);
                $temp[$key] = $value;
            }
        }

        $this->payload = new ImmutableParameter($temp);
    }
929520
public function setId($id)
    {
        if (is_null($this->id) && ! is_null($id) && ($model = $this->getRepository()->find($id))) {
            $this->id = $id;

            parent::setModel($model);
            $this->getButtons()->setModel($model);
            $this->setModelClass(get_class($model));
        }
    }
423796
public function onDeleted($event, $payload) {

        // Destructure params
        list($model) = $payload;

        // If the model is soft deleted and the config states to NOT delete if
        // soft deleted, abort here.
        if ($this->keepsFilesOnDelete($model)) return;

        // Check that the model supports uploads through Upchuck
        if (!$this->supportsUploads($model)
            || !($attributes = $model->getUploadAttributes())) return;

        // Loop through the all of the upload attributes and get the values using
        // "original" so that you get the file value before it may have been cleared.
        event(new Events\HandlingDeleted($model));
        foreach($attributes as $attribute) {
            if (!$url = $model->getOriginal($attribute)) continue;
            $this->storage->delete($url);
        }
        event(new Events\HandledDeleted($model));
    }
669818
public function reply($requestId, $replyClientId, Array $payload)
	{
		$m = $this->bareMessage(static::MESSAGE_TYPE_REPLY);
		$m->ReplyClientId = $replyClientId;
		$m->RequestId = $requestId;
		$m->Payload = $payload;

		$this->send($m);
	}
827791
public function handle($event, $payload)
    {
        list($model) = $payload;

        // Get the action from the event name
        preg_match('#\.(\w+)#', $event, $matches);
        $action = $matches[1];

        // If there is matching callback method on the model, call it, passing
        // any additional event arguments to it
        $method = 'on'.Str::studly($action);
        if (method_exists($model, $method)) {
            return call_user_func_array([$model, $method], array_slice($payload, 1));
        }
    }
1221241
public function postComment($id, $body)
    {
        $this->connect();

        $comment = array(
            'body' => $body,
        );

        $this->soapClient->addComment($this->token, $id, $comment);
    }
202518
public function emit($event, Array $payload)
	{
		$m = $this->bareMessage(static::MESSAGE_TYPE_STANDARD);
		$m->Event = $event;
		$m->Payload = $payload;

		$this->send($m);
	}
1190684
public function updateUserAsyncWithHttpInfo($user_id, $payload_account)
    {
        $returnType = '';
        $request = $this->updateUserRequest($user_id, $payload_account);

        return $this->client
            ->sendAsync($request, $this->createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
382403
public function post(string $uri, array $data = [], string $payload = null)
    {
        $request = $this->getRequest($uri)
            ->setMethod('POST')
            ->setPosts($data)
            ->setPayload($payload)
        ;

        return $this->send($request);
    }
232576
public function store($payload)
    {
        $payload['external'] = isset($payload['external']) ? $payload['external'] : 0;

        if ($payload['external'] != 0 && empty($payload['external_url'])) {
            throw new Exception("Your link was missing a URL", 1);
        }

        if (!isset($payload['page_id'])) {
            $payload['page_id'] = 0;
        }

        if ($payload['page_id'] == 0 && $payload['external'] == 0) {
            throw new Exception("Your link was not connected to anything, and could not be made", 1);
        }

        $link = $this->model->create($payload);

        $order = json_decode($link->menu->order);
        array_push($order, $link->id);
        $link->menu->update([
            'order' => json_encode($order),
        ]);

        return $link;
    }