getEntityInfoByPrefixedTableName() публичный Метод

Returns EntityInfo for a given table name with prefix (e.g., "wp_posts" or "wp_commentmeta")
public getEntityInfoByPrefixedTableName ( $tableName ) : EntityInfo
$tableName
Результат EntityInfo
Пример #1
0
 function delete($table, $where)
 {
     if ($this->disabled) {
         return;
     }
     $entityInfo = $this->dbSchemaInfo->getEntityInfoByPrefixedTableName($table);
     if (!$entityInfo) {
         return;
     }
     $entityName = $entityInfo->entityName;
     if (!$entityInfo->usesGeneratedVpids) {
         $this->mirror->delete($entityName, $where);
         return;
     }
     $ids = $this->detectAllAffectedIds($entityName, $where, $where);
     foreach ($ids as $id) {
         $where['vp_id'] = $this->vpidRepository->getVpidForEntity($entityName, $id);
         if (!$where['vp_id']) {
             continue;
             // already deleted - deleting postmeta is sometimes called twice
         }
         if ($this->dbSchemaInfo->isChildEntity($entityName) && !isset($where["vp_{$entityInfo->parentReference}"])) {
             $where = $this->fillParentId($entityName, $where, $id);
         }
         $this->vpidRepository->deleteId($entityName, $id);
         $this->mirror->delete($entityName, $where);
     }
 }
Пример #2
0
 /**
  * Returns entity name for a table
  *
  * @param DbSchemaInfo $schema
  * @param string $table
  * @return mixed
  */
 private function resolveEntityName($schema, $table)
 {
     $entity = $schema->getEntityInfoByPrefixedTableName($table);
     return $entity == null ? $schema->trimPrefix($table) : $entity->entityName;
 }