src/wcmf/lib/persistence/PersistentObjectProxy.php
public static function fromObject($object) {
    if ($object instanceof PersistentObjectProxy) {
      return $object;
    }
    else if ($object instanceof PersistentObject) {
      $proxy = new PersistentObjectProxy($object->getOID());
      $proxy->realSubject = $object;
      return $proxy;
    }
    else {
      throw new IllegalArgumentException("Cannot create proxy from unknown object");
    }
  }
public static function fromObject($object) {
    if ($object instanceof PersistentObjectProxy) {
      return $object;
    }
    else if ($object instanceof PersistentObject) {
      $proxy = new PersistentObjectProxy($object->getOID());
      $proxy->realSubject = $object;
      return $proxy;
    }
    else {
      throw new IllegalArgumentException("Cannot create proxy from unknown object");
    }
  }
public static function fromObject ( $ object ) { if ( $ object instanceof PersistentObjectProxy ) { return $ object ; } else if ( $ object instanceof PersistentObject ) { $ proxy = new PersistentObjectProxy ( $ object -> getOID ( ) ) ; $ proxy -> realSubject = $ object ; return $ proxy ; } else { throw new IllegalArgumentException ( "Cannot create proxy from unknown object" ) ; } }
Create a PersistenceProxy instance from a PersistentObject. This is useful
if you want to prevent automatic loading of the subject if it is already loaded.
Returns the argument, if already an PersistentObjectProxy instance.
@param $object The PersistentObject or PersistentObjectProxy
@return PersistentObjectProxy
Create a PersistenceProxy instance from a PersistentObject . This is useful if you want to prevent automatic loading of the subject if it is already loaded . Returns the argument if already an PersistentObjectProxy instance .