Returns if the zone exists.

@param int|string $layoutId
@param int $status
@param string $identifier

@return bool
512613
public function zoneExists($layoutId, int $status, string $identifier): bool
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('count(*) AS count')
            ->from('ngbm_zone')
            ->where(
                $query->expr()->andX(
                    $query->expr()->eq('identifier', ':identifier'),
                    $query->expr()->eq('layout_id', ':layout_id')
                )
            )
            ->setParameter('identifier', $identifier, Type::STRING)
            ->setParameter('layout_id', $layoutId, Type::INTEGER);

        $this->applyStatusCondition($query, $status);

        $data = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        return (int) ($data[0]['count'] ?? 0) > 0;
    }
1118230
public boolean containsResourceBundleOfID (@Nullable final String sBundleID)
  {
    if (StringHelper.hasNoText (sBundleID))
      return false;

    return m_aRWLock.readLocked ( () -> m_aMapToBundle.containsKey (sBundleID));
  }
1013641
public function load($contentTypeId, $status = Type::STATUS_DEFINED)
    {
        return $this->loadFromRows(
            $this->contentTypeGateway->loadTypeData($contentTypeId, $status),
            $contentTypeId,
            $status
        );
    }
1266050
public function deleteAction($layoutId)
    {
        $em = $this->get('doctrine.orm.entity_manager');
        $layout = $em->find('LexikMailerBundle:Layout', $layoutId);

        if (!$layout) {
            throw $this->createNotFoundException(sprintf('No layout found for id "%d".', $layoutId));
        }

        $em->remove($layout);
        $em->flush();

        return $this->redirect($this->generateUrl('lexik_mailer.layout_list'));
    }
705856
public function setLayoutId( $layoutId )
    {
        $this->_layout  = null;
        $this->layoutId = ( (int) $layoutId ) ?: null;
        return $this;
    }
1882
public function setDefaultLayout($layoutId): bool
    {
        $layout = new LayoutRecord();
        $layout->id = $layoutId;
        $layout->name = 'Default';
        $layout->isDefault = true;

        return $layout->save();
    }
1171768
public function loadZoneData($layoutId, int $status, string $identifier): array
    {
        $query = $this->getZoneSelectQuery();
        $query->where(
            $query->expr()->andX(
                $query->expr()->eq('layout_id', ':layout_id'),
                $query->expr()->eq('identifier', ':identifier')
            )
        )
        ->setParameter('layout_id', $layoutId, Type::INTEGER)
        ->setParameter('identifier', $identifier, Type::STRING);

        $this->applyStatusCondition($query, $status);

        return $query->execute()->fetchAll(PDO::FETCH_ASSOC);
    }
979963
@Override
    public ApiZone find(int id) {
        Zone zone = SmartFoxServer.getInstance()
                .getZoneManager()
                .getZoneById(id);
        if(zone != null && zone.containsProperty(APIKey.ZONE)) 
            return (ApiZone) zone.getProperty(APIKey.ZONE);
        return null;
    }
77043
private static boolean idsAreEqual(String id, UIComponent cmp)
    {
        if (id.equals(cmp.getId()))
        {
            return true;
        }

        return false;
    }
856043
public Notification makeStatusBarNotification(NotificationRemote remote, NotificationEntry entry, int layoutId) {
        if (DBG) Log.v(TAG, "makeStatusBarNotification - " + entry.ID);

        final int entryId = entry.ID;
        final CharSequence title = entry.title;
        final CharSequence text = entry.text;
        CharSequence tickerText = entry.tickerText;

        NotificationCompat.Builder builder = remote.getStatusBarNotificationBuilder();
        if (entry.smallIconRes > 0) {
            builder.setSmallIcon(entry.smallIconRes);
        } else {
            Log.w(TAG, "***************** small icon not set.");
        }

        if (tickerText == null) {
            Log.w(TAG, "***************** tickerText not set.");
            tickerText = title + ": " + text;
        }

        if (entry.largeIconBitmap != null) {
            builder.setLargeIcon(entry.largeIconBitmap);
        }

        builder.setTicker(tickerText);
        builder.setContentTitle(title);
        builder.setContentText(text);
        builder.setShowWhen(entry.showWhen);

        if (entry.showWhen && entry.whenLong > 0) {
            builder.setWhen(entry.whenLong);
        }

        if (entry.progressMax != 0 || entry.progressIndeterminate) {
            builder.setProgress(entry.progressMax, entry.progress, entry.progressIndeterminate);
        }

        builder.setAutoCancel(entry.autoCancel);
        builder.setOngoing(entry.ongoing);
        builder.setDeleteIntent(remote.getDeleteIntent(entry));
        builder.setContentIntent(remote.getContentIntent(entry));

        if (entry.hasActions()) {
            ArrayList<NotificationEntry.Action> actions = entry.getActions();
            for (NotificationEntry.Action act : actions) {
                builder.addAction(act.icon, act.title, remote.getActionIntent(entry, act));
            }
        }

        if (entry.useSystemEffect) {
            int defaults = 0;
            if (entry.playRingtone) {
                if (entry.ringtoneUri != null) {
                    builder.setSound(entry.ringtoneUri);
                } else {
                    defaults |= Notification.DEFAULT_SOUND;
                }
            }

            if (entry.useVibration) {
                if (entry.vibratePattern != null) {
                    builder.setVibrate(entry.vibratePattern);
                } else {
                    defaults |= Notification.DEFAULT_VIBRATE;
                }
            }

            if (defaults != 0) {
                builder.setDefaults(defaults);
            }
        }

        return builder.build();
    }
1086867
protected function regionUpdate(Layout $layout, Region $region)
    {
        if ($region->isUpdated()) {

            $this
                ->db
                ->delete('ucms_layout_data')
                ->condition('layout_id', $layout->getId())
                ->condition('region', $region->getName())
                ->execute()
            ;

            $values = [];

            /* @var $item Item */
            foreach ($region as $delta => $item) {
                $values[] = [
                    $layout->getId(),
                    $region->getName(),
                    $item->getNodeId(),
                    $delta,
                    $item->getViewMode(),
                ];
            }

            if (!empty($values)) {
                $q = $this->db->insert('ucms_layout_data');
                $q->fields(['layout_id', 'region', 'nid', 'weight', 'view_mode']);
                foreach ($values as $row) {
                    $q->values($row);
                }
                $q->execute();
            }

            // And create the node references

            $region->toggleUpdateStatus(false);

            return true;
        }

        return false;
    }
979119
public function platformIdsRangeIsExist($pageMinValue, $pageMaxValue, $tplMinValue, 
	                                        $tplMaxValue, $pids_id)
	{
	    $select = $this->tableGateway->getSql()->select();
	    $select->where->between('pids_page_id_start', $pageMinValue, $pageMaxValue);
	    $select->where->OR->between('pids_page_id_end', $pageMinValue, $pageMaxValue);
        
	    $select->where->OR->between('pids_tpl_id_start', $tplMinValue, $tplMaxValue);
	    $select->where->OR->between('pids_tpl_id_end', $tplMinValue, $tplMaxValue);
	    
	    
	    $resultSet = $this->tableGateway->selectWith($select);
	    if (!empty($resultSet))
	    {
	        $result = $resultSet->toArray();
	        if (!empty($result))
	        {
	            // Checking the Number of Rows
	            if (count($result)==1)
	            {
	                // Checking if the ID is the current data that using updating
	                if ($result[0]['pids_id']==$pids_id)
	                    return true;
	            }
	        }
	        else
	            return true;
	    }
	    
	    return false;
	}
338478
public static boolean isSRIDValid(int srid, Connection connection) throws SQLException {
        PreparedStatement ps = null;
        ResultSet rs = null;
        String queryCheck = "SELECT count(SRID) from PUBLIC.SPATIAL_REF_SYS WHERE SRID = ?";
        try {
            ps = connection.prepareStatement(queryCheck);
            ps.setInt(1, srid);
            rs = ps.executeQuery();
            if (rs.next()) {
                return rs.getInt(1) != 0;
            }
        } finally {
            if (rs != null) {
                rs.close();
            }
            if (ps != null) {
                ps.close();
            }
        }
        return false;
    }
609290
public function deleteLayoutZones($layoutId, ?int $status = null): void
    {
        $query = $this->connection->createQueryBuilder();
        $query->delete('ngbm_zone')
            ->where(
                $query->expr()->eq('layout_id', ':layout_id')
            )
            ->setParameter('layout_id', $layoutId, Type::INTEGER);

        if ($status !== null) {
            $this->applyStatusCondition($query, $status);
        }

        $query->execute();
    }
561272
public static Integer getLayoutId(Class myClass) {
        Annotation annotation = myClass.getAnnotation(LayoutId.class);

        if (annotation instanceof LayoutId) {
            LayoutId layoutIdAnnotation = (LayoutId) annotation;
            return layoutIdAnnotation.value();
        }

        return null;
    }
775399
public boolean isPresentInExternalStore(String id) {
        if (_sessions != null) {
            return ((BackedHashMap) _sessions).isPresent(id);
        }
        return false;
    }
858312
private function assertSingleInterfaceProvider($identifier)
    {
        if (count($this->interfaceProviders[$identifier]) > 1) {
            throw new ConfigurationException(
                sprintf(
                    "Expected only 1 interface provider for '%s' but got %d:\n'%s' " .
                    "because of this the service can not be uniquely resolved",
                    $identifier,
                    count($this->interfaceProviders[$identifier]),
                    implode(', ', $this->interfaceProviders[$identifier])
                )
            );
        }
    }