getTitle() public method

If there is no field called 'title' then we just return the first text type field.
public getTitle ( ) : string
return string
Example #1
0
 /**
  * Transition a record's owner if permitted.
  *
  * @param Content $entity
  * @param integer $ownerId
  */
 protected function transistionRecordOwner(Content $entity, $ownerId)
 {
     $recordId = $entity->getId();
     $contentTypeName = (string) $entity->getContenttype();
     $canChangeOwner = $this->users->isAllowed("contenttype:{$contentTypeName}:change-ownership:{$recordId}");
     if (!$canChangeOwner) {
         $this->loggerFlash->error(Trans::__('general.access-denied.content-not-modified', ['%title%' => $entity->getTitle()]));
         return;
     }
     $entity->setOwnerid($ownerId);
     $entity->_modified = true;
 }