@param FacadeInterface $facade
@param array           $params

@return UserInterface|null
963321
public function reverseTransform(FacadeInterface $facade, array $params = array())
    {
        $statuses = array();
        $statusesFacade = $facade->getStatuses();
        foreach ($statusesFacade as $statusFacade) {
            $status = $this->getContext()->reverseTransform('status', $statusFacade);
            if (null !== $status) {
                $statuses[] = $status;
            }
        }

        return $statuses;
    }
1935
public function query($statement, $params = array())
    {
        $returnValue = null;

        
//         $trace=debug_backtrace();
//         $caller=array_shift($trace);
//         $caller=array_shift($trace);
//         common_Logger::d('trace : '. $caller['function'] .$caller['class'] );
//         common_Logger::d($statement . implode('|', $params));
       	$sth = $this->persistence->query($statement,$params);
		
        if (!empty($sth)){
        	$returnValue = $sth;
        }

        $this->incrementNrOfQueries();
        return $returnValue;
    }
483402
public function call($methodName, array $params = array())
    {
        $options = array_merge($this->defaultApiOptions, $this->createConfigByMethodName($methodName));
        if (in_array($methodName, $this->postMethodNames)) {
            if (!($methodName == 'account/settings' && empty($params))) {
                $options['http'] = 'post';
            }
        }
        return $this->internalCall($methodName, $options, $params);
    }
1209855
public function loadUserByAPIUser(User $apiUser)
    {
        $eZSyliusUser = $this->eZUserRepository->findOneBy(
            array(
                'eZUserId' => $apiUser->getUserId(),
                'syliusUserType' => $this->syliusUserType,
            )
        );

        if (!$eZSyliusUser instanceof EzSyliusUser) {
            return null;
        }

        return $this->syliusUserRepository->find(
            $eZSyliusUser->getSyliusUserId()
        );
    }
1039715
public function transform($mixed, array $params = array())
    {
        $facade = $this->newFacade();

        $facade->username = $mixed->getUsername();
        $facade->firstName = $mixed->getFirstName();
        $facade->lastName = $mixed->getLastName();
        $facade->email = $mixed->getEmail();

        return $facade;
    }
603452
public function closure(Closure $closure, array $params = [])
    {
        $reflection = new \ReflectionFunction($closure);
        $resolved = $this->resolve($reflection->getParameters(), $params);
        return call_user_func_array($closure, $resolved);
    }
106788
public function isTrue(&$params)
    {
        $hostObj = $this->host;

        $attribute = $hostObj->subcondition;

        if (!$user = array_get($params, 'user')) {
            throw new ApplicationException('Error evaluating the user attribute condition: the user object is not found in the condition parameters.');
        }

        return parent::evalIsTrue($user);
    }
453860
public function logout( $params,
                            ManagerInterface            $sessionManager,
                            ZendAuthenticationService   $auth = null )
    {
        if ( null === $auth )
        {
            $auth = $this->getAuthenticationService();
        }

        if ( $params instanceof Traversable )
        {
            $params = ArrayUtils::iteratorToArray( $params );
        }

        $event = new Event( Event::EVENT_LOGOUT, $auth, $params );
        $event->setAuthenticationService( $auth )
              ->setSessionManager( $sessionManager );

        $this->getEventManager()
             ->trigger( $event );

        return $event->getParams();
    }
612766
public static function getInstanceWithController(
        ContainerInterface $container,
        string $controller,
        string $method,
        array $params = []
    ){
        if(!class_exists($controller)){
            throw new \InvalidArgumentException();
        }

        $controller = $container->has($controller)
            ? $container->get($controller)
            : new $controller($container)
        ;

        if(!($controller instanceof Controller)){
            throw new \InvalidArgumentException();
        }

        if(!is_callable([$controller, $method])){
            throw new \InvalidArgumentException();
        }

        return new static($container, [$controller, $method], $params);
    }
149639
protected function addRoles(FacadeInterface $facade, GroupInterface $group)
    {
        if ($this->hasGroup(CMSGroupContext::GROUP_ROLES)) {
            foreach ($group->getRoles() as $role) {
                $facade->addRole($role);
            }
        }

        return $facade;
    }
414901
public function switchUser($id, array $params = [])
    {
        if ($id instanceOf UserInterface) {
            $id = $id->getId();
        }

        $oldSession = serialize($_SESSION);

        $session = $this->getSessionContainer();
        if ($session->isSwitchedUser) {
            return false;
        }

        $session->session      = $oldSession;
        $session->isSwitchedUser = true;
        $session->originalUser = $this->exchangeAuthUser($id);
        $session->params       = $params;
        $session->ref          = isset($params['ref']) ? $params['ref'] : $this->getController()->getRequest()->getRequestUri();

        return true;
    }
1303222
protected function addPreviewLinks(FacadeInterface $facade, NodeInterface $node)
    {
        if ($this->hasGroup(CMSGroupContext::PREVIEW) && $site = $this->siteRepository->findOneBySiteId($node->getSiteId())) {
            /** @var SiteAliasInterface $alias */
            $encryptedId = $this->encrypter->encrypt($node->getId());

            foreach ($site->getAliases() as $aliasId => $alias) {
                if ($alias->getLanguage() == $node->getLanguage()) {
                    $facade->addPreviewLink(
                        $this->getPreviewLink($node->getScheme(), $alias, $encryptedId, $aliasId)
                    );
                }
            }
        }

        return $facade;
    }
154937
public function reverseTransform(FacadeInterface $facade, array $params = array())
    {
        $source = array_key_exists('source', $params) ? $params['source'] : null;
        if ($source instanceof MediaFolderInterface) {
            $parent = $this->folderRepository->findOneById($facade->parentId);
            $source->setParent($parent);
            $event = $this->folderEventFactory->createFolderEvent();
            $event->setFolder($source);
            $this->eventDispatcher->dispatch(FolderEvents::FOLDER_MOVE, $event);
        }
    }
1328554
public function reverseTransform(FacadeInterface $facade, array $params = array())
    {
        $workflowProfiles = array();
        $workflowProfilesFacade = $facade->getWorkflowProfiles();
        foreach ($workflowProfilesFacade as $workflowProfileFacade) {
            $workflowProfile = $this->getContext()->reverseTransform('workflow_profile', $workflowProfileFacade);
            if (null !== $workflowProfile) {
                $workflowProfiles[] = $workflowProfile;
            }
        }

        return $workflowProfiles;
    }
390886
protected function runTemplate($method, array $params=[]) {
		ob_start();
		$result         = call_user_func_array([$this, $method], $params);
		$viewableBuffer = ob_get_clean();

		#result returned by method?
		if($result !== null) {
			if($result instanceof TemplateInterface) {
				if(!$result->getEngine() && $this->templateEngine)
					$result->setEngine($this->templateEngine);
				return $result->render();
			}
			elseif(is_numeric($result))
				return (string)$result;
			else
				return $result;
		}
		#output from method?
		elseif($viewableBuffer)
			return $viewableBuffer;
		#given view?
		elseif($this->view) {
			#given template engine?
			if($this->templateEngine)
				return $this->templateEngine->createTemplate()->render($this->view, (array)$this);
			#use the default render technique
			else
				return $this->renderDefaultTemplate($this->view, (array)$this);
		}
		#default view
		elseif($this->defaultView) {
			#given template engine?
			if($this->templateEngine) {
				$engine = $this->templateEngine;
				if($engine->templateExists($this->defaultView))
					return $engine->createTemplate()->render($this->defaultView, (array)$this);
			}
			#use the default render technique
			elseif($this->templateExists($this->defaultView))
				return $this->renderDefaultTemplate($this->defaultView, (array)$this);
		}
		#nothing to return
		return null;
	}
992642
public function callback(array $params = null)
	{
		$this->cleanup();

		if(null === $params){
			if(!empty($_POST)){
				$params = $_POST;
			}
		}

		if (
			empty($params) ||
			empty($params['term']) ||
			empty($params['sign']) ||
			empty($params['type'])
		) {
			throw new GatewayException('Input params is failure');
		}

		$type = $params['type'];

		if(!isset(self::$customParams[$type])){
			throw new GatewayException('Undefined type value');
		}

		$sign = $this->sign($type, $params);

		if($sign !== $params['sign']){
			throw new GatewayException('Signature check fail');
		}

		$this->rawResponse = http_build_url($params);

		/** @var stdClass response */
		$this->response = (object)$params;

		if ($this->response->rc !== '00') {
			$this->error = array(
				'type'    => self::C_ERROR_PROCESSING,
				'message' => $this->response->message,
			);
		}

		return empty($this->error);

	}
887057
public function create(ModelInterface $model)
    {
        $user = $this->container->make(UserSingularity::class);

        $user
            ->setModel($model)
            ->boot();

        return $user;
    }