修改管理员

@return 重定向列表页
421490
public function update(AdminUpdateRequest $request, $id)
    {

        $admin = $this->adminRepository->find($id);

        if (!is_null($admin)) {
            $this->adminRepository->update($admin, $request->all());
        }

        return Redirect::route('admin.admin.index');
    }
60234
public function buildQueryString() {

        if ( $this->table == '' ) E("请在model中指定数据表.");

        $query = "SELECT {$this->fields} FROM ".$this->table;

        if ( $this->alias != null )  $query .= " AS {$this->alias}";
        if ( $this->joinStr ) $query .= $this->joinStr;
        if ( $this->joinCondition ) $query .= " ON ".$this->joinCondition;

        if ( !$this->condition->isEmpty() ) $query .= $this->condition->toString();
        if ( $this->group ) $query .= " GROUP BY ".$this->group;
        if ( !$this->havingCondition->isEmpty() ) $query .= $this->havingCondition->toString();
        if ( $this->order ) $query .= " ORDER BY ".$this->order;
        if ( $this->limit ) $query .= " LIMIT ".$this->limit;

        $this->clear(); //初始化查询条件
        return $query;
    }
1216358
public function save()
    {
        if (!empty($this->log)) {

            if (!$this->check($this->config)) {
                // 检测日志写入权限
                return false;
            }

            if (empty($this->config['level'])) {
                // 获取全部日志
                $log = $this->log;
                if (!$this->config['debug'] && isset($log['debug'])) {
                    unset($log['debug']);
                }
            } else {
                // 记录允许级别
                $log = [];
                foreach ($this->config['level'] as $level) {
                    if (isset($this->log[$level])) {
                        $log[$level] = $this->log[$level];
                    }
                }
            }

            $result = $this->driver->save($log);
            if ($result) {
                $this->log = [];
            }

            return $result;
        }

        return true;
    }
559251
public function ping()
    {
        $ping_data = $this->pingData ? (string)$this->pingData : null;
        $raw = false;
        if ($this->protocolAccelerate && $ping_data && $this->protocol) {
            $ping_data = $this->preEncodeForClient($ping_data);
            $raw = true;
        }
        // 遍历所有客户端连接
        foreach ($this->_clientConnections as $connection) {
            // 上次发送的心跳还没有回复次数大于限定值就断开
            if ($this->pingNotResponseLimit > 0 &&
                $connection->pingNotResponseCount >= $this->pingNotResponseLimit * 2
            ) {
                $connection->destroy();
                continue;
            }
            // $connection->pingNotResponseCount 为 -1 说明最近客户端有发来消息，则不给客户端发送心跳
            $connection->pingNotResponseCount++;
            if ($ping_data) {
                if ($connection->pingNotResponseCount === 0 ||
                    ($this->pingNotResponseLimit > 0 && $connection->pingNotResponseCount % 2 === 1)
                ) {
                    continue;
                }
                $connection->send($ping_data, $raw);
            }
        }
    }
32911
public void binds(Object... array)
	{
		if(name2Index==null){
			throw new RuntimeException("html标签没有定义绑定变量,但标签实现中试图绑定"+Arrays.asList(array));
		}
		
		Iterator<Integer> it = name2Index.values().iterator();
		for (int i = 0; i < array.length; i++)
		{
			int index = it.next();
			ctx.vars[index] = array[i];
		}
	}
337794
public BoundingBox getBoundingBox() {
		BoundingBox boundingBox = null;
		if (minX != null && maxX != null && minY != null && maxY != null) {
			boundingBox = new BoundingBox(getMinX(), getMinY(), getMaxX(),
					getMaxY());
		}
		return boundingBox;
	}
758214
public int[] get() {
		if (capacity < buffer.size()) {
			capacity = buffer.size();
		}
		int[] res = buffer.toArray();
		buffer.clear(capacity);
		return res;
	}
638477
public int clearAutoValues() {
        int count = 0;
        Iterator<Map.Entry<String, String>> it = entrySet().iterator();
        while (it.hasNext()) {
            String key = it.next().getKey();
            if (key.charAt(0) == '#' && key.charAt(key.length()-1) == '#') {
                it.remove();
                ++count;
            }
        }
        return count;
    }
90203
public java.util.List<Type> getType() {  
		if (myType == null) {
			myType = new java.util.ArrayList<Type>();
		}
		return myType;
	}
767936
public static Connection getConnection() {
        Connection connection = tl_conn.get();
        try {
            // 若tl.get()返回不是null说明当前线程有事务连接，直接返回事务连接
            if (connection != null) {
                return connection;
            }
            // 若为null则从连接池里返回一个连接
            connection = dataSource.getConnection();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
        return connection;
    }
579811
public Object getControlValue()
    {
        int iIndex = this.getSelectedIndex();
        try   {
            FieldTable table = m_record.getTable();
            if (m_strIndexValue != null)
                if (iIndex != 0)
                    if (table.get(iIndex - 1) != null)  // I use get, so the index matches the index of JComboBox
            {
                FieldInfo field = m_record.getField(m_strIndexValue);
                if (field == null)
                    field = m_record.getField(0);
                return field.getData();
            }
        } catch (Exception ex)  {
            ex.printStackTrace();
        }
        if (iIndex == 0)
            return null;    // None selected.
        return this.getSelectedItem();
    }
173578
public function bind()
    {
        if (func_num_args()) {
            $bindings = new Bindings(func_get_args(), $this->rules);
            $this->rules = $bindings->rules();
        }

        return $this;
    }
362075
public function delete()
    {
        // Define wheres
        $where = $this->getWhereString();

        // Define where in
        $whereIn = $this->getWhereInString();

        // Build query
        $this->query = 'DELETE FROM ' . $this->table . ' '. $where . ' ' . $whereIn;

        // Prepare statement
        $this->statement = $this->pdo->prepare($this->query);

        // Bind where values
        if (count($this->wheres)) {
            $this->bindWheres();
        }

        // Execute statement
        $result = $this->statement->execute();

        // Reset values
        $this->reset();

        // Return result
        return $result;
    }
471043
public T remove() {
        lock.lock();

        try {
            if(queue.isEmpty())
                return null;
            El<T> el=queue.poll();
            count-=el.size;
            not_full.signalAll();
            return el.el;
        }
        finally {
            lock.unlock();
        }
    }
893040
function() {
                    this.constructor.store[this.__get(this.constructor.id)] = this;
                    return can.Map.prototype._bindsetup.apply(this, arguments);
                }
431868
public function remove(){
        $query = Query::delete()
            ->from(static::$_name);
        
        $conditions = [];
        $bind = [];
        
        foreach(static::$_primary as $key){
            $conditions[] = $key . ' = ?';
            $bind[] = Type\Base::getTypeObject(static::$_columns[$key], $this[$key]);
        }
        
        $query->where(implode(' AND ', $conditions))
            ->bind($bind)
            ->setDbAdapter(static::$_dbAdapter)
            ->setConsistency(static::$_writeConsistency);
        
        return $query->querySync();
    }
862092
public function toArray()
    {
        $arr = [];
        // 从保存未定义属性的变量中读取字段kv
        foreach ($this->attrs as $field => $value) {
            $arr[$field] = $value;
        }

        // 从指定的属性中读取字段kv
        foreach ($this->columnMap as $field => $attr) {
            if (property_exists($this, $attr)) {
                $arr[$field] = $this->$attr;
            } else {
                unset($arr[$field]);
            }
        }

        return $arr;
    }