src/Listeners/ImportHistoryListener.php
/**
     * Load's and return's the admin user with the passed username.
     *
     * @param string $username The username of the admin user to return
     *
     * @return array|null The admin user with the passed username
     */
Load's and return's the admin user with the passed username.
@param string $username The username of the admin user to return

@return array|null The admin user with the passed username
Load ' s and return ' s the admin user with the passed username . @param string $username The username of the admin user to return @return array|null The admin user with the passed username
protected function loadAdminUserByUsername($username)
    {
        if (sizeof($adminUsers = $this->getImportProcessor()->getAdminUsers()) === 0) {
            throw new \Exception('Can\'t find any admin user to update import history with');
        }
        foreach ($adminUsers as $adminUser) {
            if ($adminUser[MemberNames::USERNAME] === $username) {
                return $adminUser;
            }
        }
        $this->getSystemLogger()->debug(sprintf('Admin user with name "%s" is not available, use first available user to save import history', $username));
        return current($adminUsers);
    }
protected function loadAdminUserByUsername ( $ username ) { if ( sizeof ( $ adminUsers = $ this -> getImportProcessor ( ) -> getAdminUsers ( ) ) === 0 ) { throw new \ Exception ( 'Can\'t find any admin user to update import history with' ) ; } foreach ( $ adminUsers as $ adminUser ) { if ( $ adminUser [ MemberNames :: USERNAME ] === $ username ) { return $ adminUser ; } } $ this -> getSystemLogger ( ) -> debug ( sprintf ( 'Admin user with name "%s" is not available, use first available user to save import history' , $ username ) ) ; return current ( $ adminUsers ) ; }
Load's and return's the admin user with the passed username.
Load ' s and return ' s the admin user with the passed username .
// query whether or not at least one admin user is available // try to find the admin user with the passed passeword // log a warning that the admin user with the passed username is not available // return the first admin user otherwise