/**
  * 
  *
  * @return void
  */
 public function replace(MString $find, MString $replace)
 {
     $this->string = str_replace($find->stringValue(), $replace->stringValue(), $this->stringValue());
 }
示例#2
0
 /**
  * 
  *
  * @return MDate
  */
 public static function parseString(MString $string)
 {
     return MDate::parse($string->stringValue());
 }
示例#3
0
 /**
  *
  *
  * @return MData
  */
 public static function parseBase64String(MString $base64String)
 {
     return new MData(base64_decode($base64String->stringValue()));
 }
 /**
  * 
  *
  * @return void
  */
 public function writeString(MString $string)
 {
     $this->stream->write($string->stringValue());
 }
示例#5
0
 /**
  * 
  *
  * @return MRange
  */
 public function rangeOfString(MString $string)
 {
     $pos = strpos($this->stringValue(), $string->stringValue());
     if ($pos !== false) {
         return MRangeMake($pos, $string->length());
     } else {
         return MRange::RANGE_NOT_FOUND;
     }
 }
示例#6
0
 /**
  *
  */
 public function isKindOfClass(MString $class)
 {
     return is_a($this, $class->stringValue());
 }
示例#7
0
 /**
  * 
  *
  * @return MString
  */
 public function componentsJoinedByString(MString $separator)
 {
     return new MString(implode($separator->stringValue(), $this->array));
 }
 /**
  * Parses one or more Managed Objects from inside the specified XML string
  * and inserts them into this Managed Object Context
  *
  * @param MString $string A string containing the XML representation of the objects to be parsed
  * @param callable $callback A callback function which will be called every time a new
  * object is parsed and added into the Managed Object Context. The method signature for the
  * callback is callback(MManagedObject $object);
  *
  * @return MArray An Array containing the parsed objects
  */
 public function parseObjectsFromString(MString $string, callable $callback = null)
 {
     $xml = simplexml_load_string($string->stringValue());
     return $this->parseObjectsFromXML($xml, $callback);
 }