Returns the last Join Node

@throws UnexpectedValueException If no Join Node was found
@return Join
330751
protected function getLastJoinSource()
    {
        $lastJoin = current(array_slice($this->nodes->source->right, -1, 1));

        if (!$lastJoin instanceof Join) {
            throw new UnexpectedValueException(
                "You are not in a Join Operation. Call join() first"
            );
        }

        return $lastJoin;
    }
909969
public long getLastInsertId() throws SQLException {
    // A default connection: autocommit = true.
    long num = -1;
    try {
      num = ((Number) this.queryRunner
          .query(this.conn, "SELECT LAST_INSERT_ID();", new ScalarHandler<>(1)))
          .longValue();
    } catch (final SQLException ex) {
      logger.error("can not get last insertion ID");
      throw ex;
    }
    return num;
  }
1223652
public function leftJoinWithout() {

        // Sort and count the time slots.
        $buffer = TimeSlotHelper::merge($this->getTimeSlots());
        $number = count($buffer);

        // Check the time slots count.
        if (0 === $number) {
            return [$this];
        }

        // Initialize the output.
        $output = [$this];

        // Handle each time slot.
        for ($i = 0; $i < $number; ++$i) {

            //
            $j = count($output) - 1;

            // Left join without.
            $res = TimeSlotHelper::leftJoinWithout($output[$j], $buffer[$i]);
            if (null === $res) {
                continue;
            }

            //
            $output[$j] = $res[0];
            if (2 === count($res)) {
                $output[] = $res[1];
            }
        }

        // Return the output.
        if (1 === count($output) && $this === $output[0]) {
            return [];
        }
        return $output;
    }
667605
public function mapObjects()
    {
        if ($this->mapObjects === null) {
            $objType = $this->objType();
            if (!$objType) {
                throw new UnexpectedValueException(sprintf(
                    '%1$s cannot create collection map. Object type is not defined.',
                    get_class($this)
                ));
            }

            $loader = $this->collectionLoader();
            $loader->setModel($this->proto());

            $collectionConfig = $this->collectionConfig();
            if (is_array($collectionConfig) && !empty($collectionConfig)) {
                unset($collectionConfig['properties']);
                $loader->setData($collectionConfig);
            }

            $callback = function(&$obj) {
                $obj->mapInfoboxTemplate = $this->infoboxTemplate();

                if ($this->latProperty() && $this->latProperty()) {
                    $obj->mapShowMarker = true;
                    $obj->mapLat = $this->getPropertyValue($obj, $this->latProperty());
                    $obj->mapLon = $this->getPropertyValue($obj, $this->lonProperty());

                    if (!$obj->mapLat || !$obj->mapLon) {
                        $obj = null;
                    }
                } else {
                    $obj->mapShowMarker = false;
                }

                if ($this->pathProperty()) {
                    $mapPath = $this->getPropertyValue($obj, $this->pathProperty());
                    if ($mapPath) {
                        $obj->mapShowPath = true;
                        // Same type of coords.
                        $obj->mapPath = $this->formatPolygon($mapPath);

                        if (!$obj->mapPath) {
                            $obj = null;
                        }
                    } else {
                        $obj->mapShowPath = false;
                    }
                }

                if ($this->polygonProperty()) {
                    $mapPolygon = $this->getPropertyValue($obj, $this->polygonProperty());
                    if ($mapPolygon) {
                        $obj->mapShowPolygon = true;
                        $obj->mapPolygon = $this->formatPolygon($mapPolygon);

                        if (!$obj->mapPolygon) {
                            $obj = null;
                        }
                    } else {
                        $obj->mapShowPolygon = false;
                    }
                }
            };

            $loader->setCallback($callback->bindTo($this));

            $this->mapObjects = $loader->load();
        }

        foreach ($this->mapObjects as $obj) {
            $GLOBALS['widget_template'] = $obj->mapInfoboxTemplate;
            yield $obj;
            $GLOBALS['widget_template'] = '';
        }
    }
1098856
protected function getAddon()
    {
        if ($addon = $this->option('addon')) {
            $env = app(AddonEnvironment::class);

            if (!$env->exists($addon)) {
                throw new UnexpectedValueException("Addon '$addon' is not found.");
            }

            return $env->addon($addon);
        } else {
            return;
        }
    }
518347
@Override
    public E last()
    {
        if (list.isEmpty())
        {
            throw new NoSuchElementException();
        }
        return list.get(list.size()-1);
    }
85123
public function getCachedMethodMissingMemberReferences()
    {
        $cache_directory = $this->config->getCacheDirectory();

        if (!$cache_directory) {
            return null;
        }

        $class_member_cache_location = $cache_directory . DIRECTORY_SEPARATOR . self::METHOD_MISSING_MEMBER_CACHE_NAME;

        if (!is_readable($class_member_cache_location)) {
            return null;
        }

        $class_member_reference_cache = unserialize((string) file_get_contents($class_member_cache_location));

        if (!is_array($class_member_reference_cache)) {
            throw new \UnexpectedValueException('The reference cache must be an array');
        }

        return $class_member_reference_cache;
    }
406777
public function getCachedFileMemberReferences()
    {
        $cache_directory = $this->config->getCacheDirectory();

        if (!$cache_directory) {
            return null;
        }

        $file_class_member_cache_location = $cache_directory . DIRECTORY_SEPARATOR . self::FILE_CLASS_MEMBER_CACHE_NAME;

        if (!is_readable($file_class_member_cache_location)) {
            return null;
        }

        $file_class_member_reference_cache = unserialize((string) file_get_contents($file_class_member_cache_location));

        if (!is_array($file_class_member_reference_cache)) {
            throw new \UnexpectedValueException('The reference cache must be an array');
        }

        return $file_class_member_reference_cache;
    }
98933
public function getLastTokenPosition()
    {
        $endNamespaceTokenPosition = $this->namespaceNode->getAttribute('endTokenPos');

        /** @var Node $lastNamespaceNode */
        $lastNamespaceNode         = end($this->namespaceNode->stmts);
        $endStatementTokenPosition = $lastNamespaceNode->getAttribute('endTokenPos');

        return max($endNamespaceTokenPosition, $endStatementTokenPosition);
    }
569105
function delete() {
		$this->table->notify($this, "delete");
		$rowset = $this->table->delete($this->criteria(), "*");
		if (!count($rowset)) {
			throw new \UnexpectedValueException("No row deleted");
		}
		$this->data = $rowset->current()->data;
		return $this->prime();
	}
60516
public List<JoinColumn<ManyToOne<T>>> getAllJoinColumn()
   {
      List<JoinColumn<ManyToOne<T>>> list = new ArrayList<JoinColumn<ManyToOne<T>>>();
      List<Node> nodeList = childNode.get("join-column");
      for(Node node: nodeList)
      {
         JoinColumn<ManyToOne<T>>  type = new JoinColumnImpl<ManyToOne<T>>(this, "join-column", childNode, node);
         list.add(type);
      }
      return list;
   }
428102
protected function buildWhere(): string
    {
        if ($this->query->getWhere() === null) {
            return '';
        }

        $where = $this->query->getWhere();
        if (count($where) !== 1) {
            throw new \UnexpectedValueException('Something went wrong: internal query property should always contain only one root element or bu null');
        }

        if (isset($where[LogicOp:: AND])) {
            $logicOp = LogicOp:: AND;
            $clauses = $where[LogicOp:: AND];
        } else {
            if (isset($where[LogicOp:: OR])) {
                $logicOp = LogicOp:: OR;
                $clauses = $where[LogicOp:: OR];
            } else {
                return false;
            }
        }

        return ' where ' . $this->buildClauses($logicOp, $clauses);
    }
1351386
public ElemTemplateElement getLastChildElem()
  {

    ElemTemplateElement lastChild = null;

    for (ElemTemplateElement node = m_firstChild; node != null;
            node = node.m_nextSibling)
    {
      lastChild = node;
    }

    return lastChild;
  }
55902
protected int getNextNode()
  {
    if (null != m_exprObj)
    {
      m_lastFetched = m_exprObj.nextNode();
    }
    else
      m_lastFetched = DTM.NULL;

    return m_lastFetched;
  }
43016
function export() {
		$export = array_merge($this->data, $this->cell);
		foreach ($export as &$val) {
			if ($val instanceof Cell) {
				if ($val->isExpr()) {
					throw new \UnexpectedValueException("Cannot export an SQL expression");
				}
				$val = $val->get();
			}
		}
		return $export;
	}
1368342
BaseRow removeLast() {
		Map.Entry<BaseRow, Collection<BaseRow>> last = treeMap.lastEntry();
		BaseRow lastElement = null;
		if (last != null) {
			Collection<BaseRow> list = last.getValue();
			lastElement = getLastElement(list);
			if (lastElement != null) {
				if (list.remove(lastElement)) {
					currentTopNum -= 1;
				}
				if (list.size() == 0) {
					treeMap.remove(last.getKey());
				}
			}
		}
		return lastElement;
	}
34955
public function sqlLoad()
    {
        if (!$this->hasTable()) {
            throw new UnexpectedValueException(
                'Can not get SQL SELECT clause. No table defined.'
            );
        }

        $selects = $this->sqlSelect();
        $tables  = $this->sqlFrom();
        $filters = $this->sqlFilters();
        $orders  = $this->sqlOrders();
        $limits  = $this->sqlPagination();

        $query = 'SELECT '.$selects.' FROM '.$tables.$filters.$orders.$limits;
        return $query;
    }